You can usually give notice to your employer verbally or in writing, although your contract may say it must be in writing. Even if you’re allowed to give your notice verbally, however, it’s a good idea to hand in a resignation letter.
If you resign in the ‘heat of the moment’ (eg during an argument) and you change your mind, you should tell your employer immediately. They can choose if they want to accept your resignation or not.
You may be in breach of your contract if you don’t give enough notice, or give notice verbally when it should be given in writing.