Check your phone takes an eSIM
Open the Phone app and dial *#06#. If you see a number labelled EID, your phone supports eSIM. It also needs to be unlocked, so not tied to one network. Phones bought outright usually are; if you are not sure, ask your network before you buy.