Close all applications & shut down the computer , and plug the charger .
Press command + R + power key simultaneously , don't release the keys until apple logo appears , the bar will load slowly , let it be completed after a while you will enter in recovery mode .if you have enabled firmware password , turn it off .
Take your cursor on top menu bar & click on utilities > open terminal from here & type resetpassword the word is single & no space , all alphabets are small .Click on enter & close the terminal window .
On the screen you will see user name of the account , just select it ( press forcefully on it to get selected ) > click on next on the bottom side .
A rectangular bar appears > enter your new password carefully and click on “ SAVE “. And again go to top menu bar you will see apple logo > click on restart .
After that go to system preferences > users & groups click the pad lock by entering the new admin password that you have formed in the above steps , select the admin name of the PREVIOUS OWNER click on minus sign , a pop up window appears > select the last option delete the home folder securely > click on done this user will be deleted from the system .