How to unlock an iPhone and use any SIM worldwide: A step-by-step guide

You are going abroad for vacation in a week and you want to switch to a local sim so that you won’t get charged extravagantly by the roaming fees, but your phone is locked...