Do this first, because nothing else matters if your phone cannot use an eSIM. Most phones from 2020 onward can. That covers the iPhone XS and newer, recent Samsung Galaxy and Google Pixel models, and many others.
Your phone also needs to be carrier unlocked. If you bought it on a contract, check with your home provider that it is not locked to them. The quick test is in your settings. On an iPhone, look under General then About for an Add eSIM option. On Android, check the SIM manager screen for an option to add an eSIM.