Not all inventions are patentable. For an invention to be patentable, it should:
be novel
have an inventive step or must not be obvious to a person skilled in the art
be industrially applicable
Some other conditions also apply according to the law of each country.