Settings > Security and Privacy > More security settings > SIM card security > Toggle on 'Lock SIM card' > Follow on-screen instructions from here. It may ask for a ...
It may be useful to change the PIN code of a newly purchased iPhone (if the PIN is set to 0000 by default for example) or for safety reasons to protect from fraudulent use of your phone in case of ...