TextEdit is an application, included in macOS, which can be used for writing text. Text can be edited in both RTF (Rich Text Format) mode and as plain text. The TextEdit application is set to RTF mode by default, but with the following command you can enable plain text as default format in TextEdit.
Copy and paste the following command in macOS Terminal:
defaults write com.apple.TextEdit RichText -int 0
To revert back to the default setting use the following command:
defaults delete com.apple.TextEdit RichText