You can let your competitor buy you out at a great price. What a “bunch of money?” If over $50 Million, go for it.
If you get a huge amount of money, like $50M, then it is up to you if you want to stay on or move on.
Alternatively, you can seek out some angel investors, or sell your shares to the general public and keep control. That is the way most Silicon Valley millionaires & billionaires became rich. Then, with the money they got, they often started new businesses and did the same thing over & over again.
if you are still too small to get a King’s Ransom for your company, don’t let anyone get their foot in the door to take control away from you.