If your iPhone was in your pocket and your device is locked out or your multiple failed attempts had locked it the process to unlock remains the same.
Your data is not lost if you have a backup either on iCloud or iTunes.
If you see an iPhone or iPad unavailable message or "Security Lockout" screen
If you forgot your passcode, you can use your Apple ID and password to erase and reset your device without a computer.
Learn what to do if you see "[Device] unavailable" or "Security Lockout" on your iPhone or iPad.)
iPhone is disabled.
Following this process is the only way out if your iPhone is disabled. The steps given in this link will help you reset the passcode -> If you forgot the passcode for your iPhone, iPad, or iPod touch, or your ...
Regarding your data…
- If you have an iCloud or iTunes latest backup, then there is nothing to worry about. If not read more...
- You have synced your data to iCloud, then what you will get back is what you have synced to iCloud and uploaded to iCloud Drive; the information that is synced and stored in iCloud are, Contacts, Calendars, Bookmarks, Mail, Notes, Voice Memos, shared photos, iCloud Photos*, Health data, call history, and files you store in iCloud Drive. (*-If you had turned on iCloud Photos, your content is automatically stored in iCloud.)
- You have imported your Photos & Videos to Mac/PC then they are safely residing there on Mac/PC
- You have uploaded some of it to Cloud Drives using the Files app (iCloud Drive, Google Drive, OneDrive, DropBox, Flickr, box, AmazonDrive, Adobe Creative Cloud etc). The data remains there.
- If you have not backed up or do not have the latest backup, nor imported nor you have synced or uploaded your data to cloud drives prior to the situation that you are in, then I am sorry, all your data is lost.
Apple ID and Activation Lock
iCloud uses Apple ID credentials.
If you do not remember the Apple ID Password then follow the steps given in this Apple Article -> If you forgot your Apple ID password - Apple Support
If you do not remember the Apple ID then follow the steps given in this Apple Article -> If you forgot your Apple ID - Apple Support
If you are the owner or the owner has shared all information with you then to open Activation Lock:- If it is Activation locked, read here --> Turn off Activation Lock - Apple Support Activation Lock for iPhone, iPad, and iPod touch - Apple Support
Learn how to remove a device from a previous owner's account.
If you are not the owner and do not have the Apple ID and Password then there is no way that you can get into this iPhone unless the original owner shares the Apple ID and password with you. If you are lucky you can get into this iPhone if they (owner) accidentally remove the device from their Apple ID.