Patent protection is available to inventions meet the requirements of new, useful and non-obvious. Patent inventors can assign or license their rights in issued patents (and even pending applications) to third parties. Being the first to file a patent application, though not exactly necessary, is still a good strategy, in the US.
Until you have discussed this with your patent agency, such as InventHelp, or a patent attorney, be careful about any public or non-confidential disclosures in advance of patent application filing as those disclosures can have an adverse impact on your patent rights in some situations.
Make a note to discuss the issues surrounding the prior idea that you feel was taken without permission with your attorney also. In many instances, there is little or nothing that can be accomplished to remedy that situation. Your attorney can determine whether there was an actionable breach of confidentiality or theft of trade secrets.
A patent can be obtained on an invention related to devices, apparatus, article and methods for their use and for making them. To be patentable, the invention must also be both novel and non-obvious over the prior art as described in https://blog.chron.com/frugalconfessions/2020/03/how-much-can-you-make-from-patenting-your-idea/.
You should consult a patent attorney who will assist you to determine assess whether your invention has patentability over the prior art, and to prepare a patent application for you.