There is no shortcut: you have to buy a rescue pet. Without one, there is no pet to link, so no code will help you.
The game in question is MyEPet (myepet.com). Purchase the pet there through the official site, and the code that comes with it will work as intended. Codes listed on third-party “free pet code” pages are either already redeemed or a phishing attempt, and children's virtual pet sites are a favourite target for both.