Seems your friend would need to prepare the phone for a new owner. No-one else can do that for you. See the Apple support article below:
What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support
The above article includes how to get another password if it is forgotten.
__________________________________________________________
If unable to change the password without a trusted phone number ,
Account recovery may be used to regain access to the phone through proving correct ID to Apple. How to use account recovery when you can’t reset your Apple ID password - Apple Support