It's also very dependant on the condition it was in when you bought it. A sold or given away mac should have been prepared in a certain way for the next user eg.
Reset your Mac to factory settings to prepare it for a new owner.
support.apple.com
This is freely available and well known information.
the purpose of this above process is to return the device to the state that a new device would be in. It should open with "hello" in different languages as part of the Setup Wizard to allow you to set your own preferences, and create a personal Apple account. If that didnt happen then there are usually only two reasons. The previous owner was too lazy or he wasnt the previous owner.
Worst case scenario: It's still logged into the previous owners account.
To erase and return to as new state, as the attached article suggests, you need the owners Apple ID. User name and password to sign out. Without that I'm afraid it's just a big paperweight.
Best case scenario; the previous owner has signed out but not completed the reinstallation of the original Operating System.
If so can talk you through doing that but it would be very helpful to know the year and model as mentioned by Jimmysb.