If you've heard of patents before you've probably heard of the term prior art. A prior art is generally a public document that demonstrates the state of the art at a particular time.
Since patents are only awarded to an inventor for an invention that's new and inventive over the current state of the art, when you file a patent application you want to know if there's any prior art that can make your patent application not new or not inventive. In Canada, any prior art from a third party that publicly disclosed your invention before you filed your patent application will take away your patent rights because it will make your patent application not new or not inventive.
So what should you do? Before drafting your patent application, a search for prior art should be done to assess the current state of the art. Knowing what kind of prior art is out there means that your patent application can be drafted so that it remains new and inventive over the prior art and increases its chances of being allowed as a patent.