Take it back to the seller and ask the seller to remove the lock, or ask for a refund. Without the sign-in information, or a receipt from an official Apple retailer, the computer is useless to you. The warranty card and box are not proof of legitimate purchase.
Apple has two related features, Activation Lock ( Activation Lock for iPhone and iPad - Apple Support ) and Find My ( iCloud+ - Find My - Apple ), which are designed to prevent anyone else from using a Mac if it's ever lost or stolen. Deactivation of either requires knowing the Apple ID and password that set the feature, or by placing a special request to Apple to reset the device. This Apple ID information essentially defines the current ownership of the device.
If you do not know the required information, are not the signed-in owner, or do not have Apple accepted proof of purchase, get the owner of the account to remove the lock (described in How to remove Activation Lock - Apple Support ), or return the device for a refund, or recycle the Mac. The device is otherwise useless to you. If the owner is unknown and has not provided contact information as a message showing in the login screen, there is no way to contact the owner unless the person who gave you the device knows them.