The procedure is following:-
Open Finder > Applications > TextEdit
Also change some preferences to get the application to
save files correctly.
In Preferences > Format >
choose "Plain Text"
Then under "Open and Save", check the box that says "Ignore rich text
commands in HTML files".
Then open a new document to place the code.