Reset an iMac to factory without passwords I got gifted an IMac from a friend they asked me to delete everything. It didn’t have an initial password to enter so I thought it was fine. To delete it’s requesting the admin password which they don’t remember. She said I can just delete everything it’s okay she has all her stuff backed up and on new iMac. So is there a way to delete everything and ability to sign in with my apple id and password without hers?
First you'll need to turn off your iMac. Then press the power button and immediately hold down the Control and R keys until you see the Apple logo or spinning globe icon.

Release the keys and shortly afterward you should see the macOS Utilities window appear.


In this are four options: Restore from Time Machine Backup, Reinstall macOS, Get Help Online and Disk Utility. Click on the last one (Disk Utility) and then select Continue.

Next, you'll see a list of all the HDs currently attached to your Mac. In the left column are the names of each drive, while in the main panel are the details of the selected drive.

Look under the Internal section for your main drive. This is often called Macintosh HD and appears at the top of the list. Click on it so that it's highlighted, then click the Erase button from the options in the main panel. Use the same format suggested by the Erase on for your HD. 

Once you are done, come back again to the window macOS Utilities and from there select Reinstall macOS. All should go good in 25-30 minutes as it downloads from the internet.