By Anonymous (not verified)
Updated 05/27/2021
The best way to avoid this is to write down your passcode and keep it somewhere safe. If you don’t do this and forget your passcode, you’ll have to connect your iPhone to your computer and use iTunes to restore the iPhone software. This will wipe out Contacts or Calendar info you have on the device, along with any music or videos on the device. You can then sync it with your PC or Mac to get the info and files back on.