Password
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.

Turn off Lost Mode on an iPhone, iPad, iPod touch, or Apple Watch
- In Find Devices on iCloud.com, select the device in the All Devices list on the left.
- Click Lost Mode, click Stop Lost Mode, and then click Stop Lost Mode again.
Turn off Lost Mode on an iPhone, iPad, or Apple Watch
- Go to icloud.com/find, then sign in to your Apple Account (if necessary).
- Select the device below All Devices on the left.
- Click Lost Mode, click Stop Lost Mode, then click Stop Lost Mode again.
- You can also turn off Lost Mode by entering your passcode on the device. If you turned on Stolen Device Protection on your iPhone, you may need to use Face ID or Touch ID.
Note: If you had any cards suspended when you put your device in Lost Mode (credit or debit cards for Apple Pay, or student ID cards or Express Transit cards), when you turn off Lost Mode and sign back in to iCloud, you can use them again.
Use Lost Mode in Find Devices on iCloud.com - Apple Support