To remove the SIM card from your iPhone, you'll need to eject the SIM card tray with a special tool or paperclip.
To unlock your iPhone from its carrier, you'll likely need to contact your carrier directly to cancel your contract.
Changing physical SIM cards on your phone is always a fiddly business. First, you have to root for the little SIM tray tool ...
The newer eSIM technology, which is quickly becoming the standard on high-end phones, is safer and more convenient.