You can unlock your Android phone even if you've forgotten the passcode, but you'll usually need to factory reset the phone.
Recovering deleted text messages on Android is difficult, and the best strategy is to have Google Drive back up your phone.