The internet is a wonderful thing, but it's also a hotspot for scammers. How do you know that the pet you're buying is real? There are plenty of precautions you can take. Overall, make sure to trust your gut. If it seems too good to be true, it probably is!
The very first step to making sure your future pet is not a scam is checking where/who you're buying from. Pictures are great, but make sure you or someone you know can visit the pet in person before buying. That is the best way to ensure the pet you're buying is real. If you are buying from across the country, ask the seller if they are willing to do a video call. Any hesitation to confirmation on their side could suggest a scam. Also be sure to reverse-image search the pictures they send if you suspect a scam.
The main thing scammers are looking for is money. They will often ask about payment, making it the top priority of the interaction, rather than the pet. Other times, scammers will pretend to be a pet owner looking to rehome their dog or cat, asking for the money needed to transport the dog to you. These scams are harder to identify because their "transportation fee" is often low. The guidelines listed above still apply. You should never put down a payment for a pet without confirming that it is real.
One of the main things we can recommend when buying a pet is to do your research. Learn as much as you can about the seller and get multiple forms of confirmation before putting down a deposit.