To protect an idea, you need to file a patent. This will give you rights throughout the United States and a grace period within which to file overseas. You should not disclose your idea to anyone or publish or sell the product, as this may jeopardize your rights in the United States and is very likely to prevent you from seeking a patent in many countries outside the United States.
Searching, brainstorming, drafting and filing a strong utility patent application runs about $7,000 to $10,000, depending on the technology. Software and pharmaceutical patent applications are among the most expensive.
One would think that simple inventions are easiest to patent, but they are often the most difficult to patent because of the extensive prior art. One files accelerated examination, the charges to get the application on file are usually $22,000 – $25,000, but the patent may well issue within a year (or even six months), rather than 3-6 years as with a non-accelerated application as explained in https://openlab.citytech.cuny.edu/gotconcept/elon-musks-greatest-inventions/ article.
After filing it usually requires another $3,000 – $7,000 or more to prosecute the application, i.e., argue with the patent office and get the application allowed. Accelerated patent applications are usually at the low end of those numbers because the claims are already crafted very carefully to circumvent prior art discovered during a very extensive patentability search.
Some firms charge only $2,500 – $3,500 to file a utility application. Such inexpensive applications are just a waste of resources. Any patent procured from such an application will almost certainly be worthless because it will be easy to circumvent. One can file a decent provisional for $3,500, or even much less depending on the extensiveness of the inventor’s disclosure.
But that just puts off the cost of filing the utility application by a year. At the other end of the extreme some firms charge $25,000 or more just to file a patent application, and that much again for prosecution. Except in the most extreme circumstances those charges are just a rip-off as written in https://blog.chron.com/frugalconfessions/2020/03/how-much-can-you-make-from-patenting-your-idea/ post.
All the charges mentioned are for the U.S. only. Foreign patenting is much, much more expensive.