First of all, one should file a patent application.
In the patent application, you must describe your invention, provide an indication of its technical field. Such descriptions are usually accompanied by visual materials such as drawings, plans or diagrams to better understanding. The detail of a patent application must be sufficient enough for someone in the same field of art to be able to re-create the invention being patented.
In addition, depending on the applicable patent law, you may need to submit various kinds of statements, declarations or supporting documents to a patent office. In view of the complexity it is recommended that you consult a patent attorney or a patent agent to prepare a patent application.