Can anyone tell me how to save and run a html code?

Dear Experts,
I have learnt few codes of HTML. Just for the practice I am trying to save and run HTML code in notepad.
But when I save and run it, it opens in text format again.
Can anyone tell me how to save and run a html code?
