You can factory reset your iPhone and wipe all its data in the Settings app. If you don't remember your password, you can use ...
You can unlock your Android phone even if you've forgotten the passcode, but you'll usually need to factory reset the phone.