Ask your carrier to unlock it. Most will, once the phone is paid off or a contract term has passed, and it is usually free.
Do it before you buy a plan. A locked phone will take your money and then refuse the eSIM, and an installed eSIM is not refundable.
If you have already bought and not installed, we refund in full on request.