@Neil ******
You go to immigration with your passport and lease agreement and ask for a letter of residence. It should be free but will probably cost 300-500 baht (no receipt).
Some offices will do it on a short term visa. Others won’t.
Alternatively you can ask your embassy to provide one. Good luck with that route.