A letter of resignation to your CO is usually the polite thing to do and a good start.
Speak to your PSAO and adise him you want to hand your kit in. Fix a date thats suitable to both of you as its not just a matter of dumping your kit on the counter, it may take a couple of hours. If the PSAO is switched on he should have all the documentation ready for when you turn up. Sign away and thats you gone.
Have you considered leave of absense? If you leave and then regret it, it could be difficult to return, whereas if you take leave of absense for 6 months or so to sort your life out, you could see if you really do want to pack it in, or crack on.
lol there names timesup so i think that will give you a clue.but i think it's christmas go back after leave and see how you feel,everyone think's" f*ck it i'm leaving " but i don't know how long you have been in,but if it has been a few moon's you will miss it in a strange way(being cold and wet and not getting payed on time )but that's only what the war stories are all about over a pint.don't give up or transfer to a more switch on bunch.