Each Apple device is linked/associated with an Apple ID of the person who did the setup.
Activation Lock prevents anyone who is not the owner from using this MacBook.
To unlock the MacBook, you need the Apple ID and password of the previous owner (your friend), that were used during set up.
So have to contact the previous owner.
Apple cannot help you.
The previous owner (your friend) has to read -> What to do before you sell, give away, or trade in your Mac
What to do before you sell, give away, or trade in your Mac - Apple Support
Then the previous owner (your friend) has to remove the MacBook from his account, see this Apple article:
Check your Apple ID device list to see where you're signed in
Check your Apple ID device list to see where you're signed in - Apple Support
Then you can sign in with your Apple ID.
See -> Activation Lock for Mac
Activation Lock for Mac - Apple Support