If you suddenly lost all text formatting in a TextEdit document, you may have accidentally converted your file from rich text to plain text format. Plain text documents cannot be formatted.
To restore your document’s formatting, but lose any changes you’ve made since you last saved the document, choose File > “Revert to Saved.”
To keep any changes you’ve made since you last saved your document, choose Format > Make Rich Text.
You can now format your document again, but you’ll have to reapply the formatting you lost.