Doing a 'prior art' search helps you to judge whether or not your invention is 'new' and 'non-obvious' (two of the requirements for patenting the invention). The USPTO 'Patent Essentials' page discusses these requirements in more detail under the 'What can be patented?' section. If you find a patent (or other prior art) that encompasses all of the claims of your invention, then your invention is likely not 'new'. If you find multiple pieces of prior art that disclose, when combined, all of the claims of your invention, then your invention might not be 'non-obvious'.
Patents are only one type of prior art. Others might include scientific literature, YouTube videos, public presentations, basically anything that could be a public disclosure of another invention. If you'd like to learn more about prior art searching, the PTRC Representatives would be happy to help. We can be contacted via email at lib-ptrc@osu.edu.