The Japanese commissioner in Washington DC in the 1900's studying the American patent system said, "We have looked about us to see what nations are the greatest, so that we can be like them... We said, 'What makes the United States such a great nation?' and we investigated and found that it was patents, and we will have patents."
Although anyone can claim to inventor or create something (e.g., Al Gore created the Internet), the reality is that an idea needs to be carefully considered in context of the law. If you are serious about protecting your invention, you should contact a patent attorney or patent agent. Applying for a patent, and its subsequent patent prosecution process, does cost money. You may see ads for low-cost services to file a patent on your behalf. Such solutions are viable if your goal is to boast to your friends that you patented something. However, if you have real-world business ambitions, it is imperative that the person writing the claims of your patent is a well-qualified lawyer. The adage "you get what you pay for" is very true in the intellectual property community. Realistically, a single patent is going to minimally cost you around $10K for the application fees, legal fees to write the claims, and so on. You want to find a legal professional that is a subject matter expert in your domain (whether it is IT, manufacturing, mechanical engineering, biotech).