Hi. I "quietly" run a restaurant / hostel and a chain store by assisting my wife, a wonderful Thai woman and entrepreneur. Here are somethings you need to know (* disclaimer: I'm not a legal expert and don't advocate breaking the law.).
1) MOST IMPORTANT: Do you trust your spouse and that your marriage is on solid ground? To add to that, somethings your spouse is a wonderful person, your inlaws are another question altogether. Not invading your privacy but it's the simple fact that, as foreigners, we have all to lose with little to nothing to gain.
2) You're always the silent partner unless you can scale up because....
3) Be aware that cooking and working in a restaurant is a RESERVED occupation. Unless you're a highly qualified, experienced and sponsored by a huge hotel chain.
4) You are able to own your business legally but as pointed out by the posters above, there's the 4 Thais to 1 foreigner ratio. Again, you technically can't work in your own restaurant unless you can prove that it's big enough, your skillset is specialised enough.
Most likely, your wife will own the business and you're just the fellow who funded the venture with no strings attached. (see point 1 again)
5) Yes, be aware if you are to be seen doing anything. Personally, I think some of the "experiences" found on this forum is a bit outlandish, maybe even fantastical but your mileage may vary. Obviously, places like Pattaya may attract all kinds of ills.
That being said, recently in Chiang Mai an Italian was arrested for working in his own Italian pizzeria but he was right in kitchen, right in the dough mix.
The rule and your mantra for how should you be present at your place of business is "out of sight, out of mind".
There are probably a few points I'm missing, but these are the basics. I wish you all the best!
These laws are too different from many countries to be honest. Some differences maybe. Where I come from, foreigners can own and work at their own business because that's not seen as taking jobs from locals.
Like I said, my wife is an entrepreneur with a few businesses under her belt. Me, I just came over with my savings. Over time, we grew our businesses and thankfully rode out the pandemic. We have been in it together and we save for our kids' future and ours.
But officially, I'm unemployed and help around the house. I just "happened" to be around to talk to foreigners, visitors and day to day, I'm a digital nomad in plain clothes working on my computer with nothing to do with the locals.