@Eric *********
You don't. Visas are for going to a country. You get the visa before you travel to Thailand from a Thai embassy. That visa allows you to open a bank account. No visa, no bank account. Therefore you will not be getting any visa in Thailand. You will need to leave and apply for a non-O visa based on retirement or marriage from a Thai embassy, then return to Thailand with that visa and open a bank account.