If you are erasing your phone for troubleshooting purposes to start over or restore a backup, you don't need to contact your carrier at all. That will not affect your SIM card.
If you are erasing the phone to reinstall the iOS software, you should backup first if you plan on restoring a backup.
Restore your iPhone, iPad or iPod touch to factory settings - Apple Support