There is no way to be 100% sure. You can check a few things to minimize the risk. If it is a domain available for purchase through a registrar that nobody currently owns, such as in an auction, checking if it is indexed or not won't do any good. Google has been removing a lot of the domains in auctions from their index.
Check the links pointing to the site. See if you see anything really spammy going on. For example, if you see hundreds or thousands of links with anchors about air jordans, louis vuitton, viagra, etc., the domain is likely worthless.
Also check the Wayback Machine and see if it is archived there. Take a look at recent history and look to see if it looks like the previous owner was doing anything sneaky/spammy with the domain.
There are a few other things you can do that I am not willing to share publicly, but you just want to try to gather as much info and data as you can to minimize your risk. Even so, you will never be 100% positive.