It sounds like you are referring to a patent? A patent is an exclusive right granted for an invention, which is a product or a process that provides a new way of doing something, or offers a new technical solution to a problem.
Please be aware that in order to patent your idea it must:
New, which means that the invention has not been publicly disclosed in any form, anywhere in the world;
Involve an inventive step, that is to say the invention must not be obvious to someone with knowledge and experience in the technological field of the invention; and
Industrially applicable, meaning it can be mass produced.