How do I check that someone hasn’t already patented the invention?

To be sure whether a thing is patented or not, ask for a patent search. It shall give you meaningful insights for decision making and can be undertaken for multiple purposes including Patentability Check, Freedom-to-operate Check, State-of-the-art, Validity Check, and Competition Research.