A thorough prior art search is usually conducted with a view to patent and can be quite time consuming. Below are some resources which define what a prior art search is and the basic steps involved.
If you're not looking to patent specifically, but want to do a thorough search of the patent literature, then you can follow steps 1 - 5 discussed below (describe your invention - do a keyword search - do a CPC classification search - do a citation search) to identify relevant patents to your idea.
Summary of the six basic steps described in the USPTO web-based tutorial
At this point, if you've found no patents or applications related to your invention, the search is broadened to foreign patents and the non-patent literature (journal articles, conference proceedings, websites, technical catalogs, books, etc.)