Good explanations on points 1 & 2 from Jay Smith-Hill, but I'd like to expand on point 3:
How do we know that a particular product can not be sold due to patent registration?
The sum of his answer is correct to a point ... you cannot know without a shadow of a doubt. You can, however, take reasonable care by performing (or, preferably, having a professional perform) a patent search.
Do it yourself
This should always be first - and start by reading Patent It Yourself for a good understanding of patents - what they are, how they work, and how the process of applying for one works. Then, read and follow Patent Searching Made Easy.
Doing it yourself should really be a first pass to help you understand what else is out there - preferably while you are still designing your invention and before you approach a patent practitioner (attorney or agent). As a general rule, the more you know already, and can give to the practitioner, the better able they are to help you, the better results you get, and the less you spend.
Pay for a patent search
A patent search professional - some people prefer doing it through a patent attorney or agent (agent is more common, as they are lower-priced per hour than attorneys), some people prefer using a 3rd party search professional (not a patent practitioner, but often hired by them).
Starting with a thorough description of your invention and as many variations and features of it as you can think of, they will (should) systematically search the patent literature - US and worldwide, as applicable - for the closest prior art reasonably able to be found. They will do this through text searches, advanced (boolean) text searches, classification searches (searching in specific classes of patent literature), and through 'cited literature' (finding a reasonably similar patent application to your invention and looking at the literature cited by the USPTO examiner and/or the inventor as being potential prior art).
At the end, you will not have found every possible piece of prior art, but you will (should) have a reasonably accurate picture of the prior art surrounding your inventive space, and a better idea for how to move forward.
Hope this helps!
NOTE: This is NOT legal advice. Consult an attorney.