Its not a magical "pay no taxes" hat. Companies have to generate revenue to be of any benefit. I don't know what you do, but consulting is a pretty simple company to form. If you have an accounting degree, doing taxes is another bang-up one. IT consulting is also pretty popular. Driving for UberEats or Grubhub on weekends works too. What the company does for you is to help you expense out revenue so it isn't taxable. One reason consulting companies are so good is you can work out of a home office. Having a home office allows you to deduct a small portion of your mortgage/insurance etc as a deduction off the company's taxes. Home office expenses (paper, computer, internet, toner etc) are likewise written off. In and of itself this alone doesnt help you. But lets say you are able to generate 5k or 10k in revenue from your side hustle. That is only like 5-800 a month so not a huge nut. Now you have revenue to work with.
So you make 10k in a year. You then deduct a portion of your car, that home office expense, meals with "clients", travel to <insert family vacation sport here> to "meet with a client or go to a tradeshow" etc. Lets say you end up showing 11k in deductable expenses. Thus your business runs at a loss. That 10k you made is not counted as income on your Schedule C (an LLC passes through profits/losses to the owner's 1040 via the schedule C generally).
Now this doesnt sound like a lot. But consider all those expenses you would have been paying anyway (car, mortgage etc) on money the IRS would take taxes out of. So lets say you are in the 22% tax bracket, that 10k you write off as expenses on your business is a direct savings of $2200 in taxes on that 10k extra you made. The idea is to generate enough revenue to cover those costs you are paying anyways. In essence you are not paying taxes on money you are using to pay a portion of your life expenses.
Its not complicated and it is 100% legal. It only gets illegal when you start falsifying your deductions or revenue. Write off the vacation to Vegas? Make sure you spend 30 minutes talking finance or IT or whatever your business is to a guy at the bar or by the pool or to the waiter at dinner. You dont expense the wife's airline ticket (unless she has her own side hustle and LLC, hint hint) or the kid's. But if you are all staying in the same hotel room, then expensing the room is fine. Historically, the number 1 or 2 red flag to spawn an audit is people getting greedy on their home office expense and trying to write off their entire mortgage. You follow the approved IRS formula for how much you can legally expense based on square footage and stick to it. If you got a 2k mortgage and can write off 5% of it legally, thats 5% you arent deducting now.
Just like in the market... pigs get fat, hogs get audited.