If you are in Bangkok, go to a jail and ask. It's easier if you have a Thai friend accompany you, but you can do it by yourself.
The best place to try first imo would be Bangkok Remand and Klong Prem which are next to each other, or there is also Bang Kwang. Tell them the name of the person you are there to visit. If they are not there, you will soon find out. There is an office; you can try asking there for help if they are imprisoned somewhere else.
You can visit prisoners. It's been a few years since I've been to Klong Prem but I suggest you go in the morning. Prisoners get limited visits, so you don't want to go and then find someone has already visited them for the day. If you find out other people are visiting and you want to make future visits, try to work out a schedule. It's better for someone to get a few visits a week than for everyone to turn up on the same day. Make sure you have your passport with you. Have some cash so you can buy your friend any items they require from the commissary. You used to be able to deposit money to an account and pay for extra food, but I don't know if this is still the case.
Years ago the Australian Embassy was very happy to give me all the info I needed on how and where to visit an Australian I knew, so you never know.