a week before your visa is due to end. you go to the local immigration office and apply for the extension. usually you have to apply for the 30 day extension first and then the next time you go you get the 60 day covid extension. the amount of covid extensions you can get is unlimited providing they are extended by the government
you have to be in the country of your passport to apply for a visa. I'm from the UK but was in the US when we came to Thailand, unless you want to go back to your country your only option is the visa exempt entry. It can be extended and it's possible to change to a different visa once you're in Thailand. I applied for my COE through LA embassy