The message that the Mac is “linked to a different Apple Account” means that the Mac is associated with an Apple Account other than the one you are attempting to use.
The exact wording is important because this could be Activation Lock or another sign-in/setup issue.
If the screen specifically shows Activation Lock and asks for an Apple Account you do not recognise, changing your Apple Account password will not remove that lock.
Apple explains that Activation Lock is associated with the Apple Account used with Find My. If you have valid proof of purchase, Apple provides an Activation Lock support request. Apple — Activation Lock support
Because you purchased the Mac new from Target, do not assume that the unfamiliar Apple Account belongs to a previous owner or that there is necessarily a problem with the Mac.
Keep your receipt and other purchase documentation, and contact Apple Support if Activation Lock is confirmed.
Explain that the Mac was purchased new and is requesting an Apple Account you do not recognise. Apple can determine what support options are available. Apple Support
I would not erase the Mac or reinstall macOS at this stage. If Activation Lock is involved, Apple states that it remains enabled after the Mac is erased, so erasing it would not by itself resolve the problem.
Also, the Apple Account password and the Mac's local login password are separate credentials.
Consequently, repeatedly resetting the Apple Account password may not address a Mac login-password problem. Apple — If you forgot your Mac login password
The most useful next step is to provide the exact wording displayed on the screen, or upload a photo of it. That will establish whether this is Activation Lock or another setup/login issue and determine the appropriate next step.