Re: if my iPhone gets locked out with password and I can't remember it?
Find My iPhone
If you enabled Find My iPhone through iCloud, you can use it to erase your device.
Go to icloud.com/#find.
If prompted, sign in with your iCloud Apple ID.
Click All Devices at the top of your browser window.
Select the device you want to erase.
Click "Erase [device]" to erase your device and its passcode.
Use the Setup Assistant on your device to restore the most recent backup.
I'm assuming it's the lock screen passcode. If so, restoring your device and setting it up as new will allow you to basically start over anew. Having said that, if the iCloud activation lock has been enabled, you will have to know the associated Apple ID and passcode to use the device. If you do not know it, restoring the device will not help.