Writing a resignation can be difficult. It is not always easy to know exactly what to include in it. However, it is worth bearing in mind that you will want a reference after you leave and so you need to keep it formal and polite. Even if you do not, it is not a good thing to offend someone by writing a rude letter even if you are leaving because of problems you have encountered in the job.
You need to explain that you are handing in your notice and that you would like to work your notice period from the date that the letter is dated. It is often common to write down the date that will be your last, so you will have to work out when that will be, calculating your required notice period. If you wish to work for longer than this, then state that as well.
You do not have to explain why you are leaving but if you do, make it positive. If you are moving house or pursuing a new career then this is acceptable, but if you left because you didn’t like working for Asda, do not mention this. It will not achieve anything apart from making the person reading it rather sad or even annoyed. They will probably be your boss and they may not like to think that you did not have a happy time in your job. This may not put them in the right mood for writing a reference if they felt that any enthusiasm you had was forced rather than because you enjoyed what you were doing. It may feel better to get something negative off your chest but it will not achieve anything in the long run.
It is good to include a thank you, perhaps not a personal one, but in general to the company. You could mention specific people if you think they really stood out, but generally mention your enjoyment for working for the company and perhaps even mention a few skills that you learnt. This could potentially prompt the person writing your reference to include those, which could be useful for you.
Many people do prefer to keep things very short. It is wise not to include much information as you should get an opportunity for an exit interview where you can discuss any issues or give any praise that you wish to do so. You will also get an opportunity to thank colleagues face to face, which is much better than doing in a letter.