First, be sure it is signed OUT of iTunes and iCloud.
If the "R" on the keyboard doesn't work, you need an EXTERNAL WIRED USB keyboard.
Plug it in and use it.
However, I could not in good conscience sell a MacBook Pro with a keyboard that isn't 100%.
You had better disclose this to any potential buyer.
Really, it's more of a "give away" item at this point.
Anyway...
Do this (from a powered off state):
- press and HOLD this key combo:
Command-OPTION-R
... and press the power-on button.
KEEP HOLDING THOSE KEYS DOWN.
This is INTERNET recovery.
- When the Mac asks for your wifi password, you can let go of the keys and enter it.
- The internet utilities take a while to load, be patient.
- When the internet utilities are loaded, open disk utility.
- VERY IMPORTANT: go to the "view" menu and choose "show all devices".
(you can't see the internal drive until you do this!)
- Look at "the list on the left".
- The topmost item is the drive inside.
- Click on the internal drive ONE time to select it, then click the "erase" button.
- Erase to "APFS, GUID partition format".
- Quit disk utility and open the OS installer
- The OS installer should offer you OS 11 "Big Sur".
- Start "clicking through". The Mac will reboot one or more times, and the screen will go dark for a minute or more, with no other indication of activity.
- When done, you should see the initial setup screen (choose your language).
At this point, type "command-Q" to quit the installer.
Then see if you can shut it down using the menus.
Or... just PRESS AND HOLD the power on button until the screen goes dark and the Mac shuts down.
It's now ready for the next owner.