I’ve contracted/freelanced exclusively since 2008, mostly W-2 employee before then. In the software business for 40 years.

You want to make as much of your work time as possible billable. Stuff like government paperwork (incorporation), time tracking, invoicing, taxes, banking, marketing, contracts can take up time you don’t get paid for. I see a lot of freelancers spending their time and money trying to look like a “real” business but not working enough billable hours. Don’t worry about all of that, do the simplest thing possible, which most likely means sole proprietor. If you do business using your own name you don’t need any government registration.

An LLC may have some benefits, mainly providing some protection of your personal assets from lawsuits. Note that LLCs do not protect you from criminal acts such as fraud. The IRS considers single-owner LLCs as pass-through entities, meaning the income just goes to your schedule C (business income and expenses), just like a sole proprietor. S and C corp setups involve significant paperwork and ongoing management, and probably won’t give you much benefit unless you have employees, inventory, lots of income or outside investment. Consult an accountant and/or lawyer but keep in mind their freelancing business amounts to creating and managing business structures which you may not need.

To replace your W-2 salary you start by figuring out what you need to make annually, adding in the cost of paying all of your Social Security and Medicare taxes yourself, the cost of providing your own health insurance, divide by 2,000 (or however many hours per year you think you can work) to get a rough hourly rate. For example if you make $100K salary as a W-2 employee, with the employer paying half of your Social Security and Medicare and providing group health insurance, that’s $50/hr plus whatever those taxes and benefits come out to. You probably won’t work 40 hrs/week (2,000 hrs/year) at first, or all the time, so figure out what you need to make to live on, add in those taxes and health insurance costs, then divide by however many hours you expect to work. That’s the minimum hourly rate you will charge or base your estimates on. My rule of thumb is W-2 annual salary + 30% for taxes/insurance, divided by 2,000 (or less depending on how many hours/year you realistically expect to work).

Few contractors/freelancers work 40 hrs/week (2,000 hrs/year) regularly. The more unbillable time and busywork you do the less time you get paid for. Someone starting out with no customers will put in a lot of non-billable time and experience big income fluctuations. That’s scary at first, coming from the security of a regular paycheck, and too often leads to accepting the first gig that comes along, undervaluing your time and work, and committing to vague unspecified projects to get a deposit or up-front payment. Try to avoid getting into that situation. You’re safer building up a six-month minimum cushion of cash from your W-2 job unless you have customers and work already lined up.

Contracts for typical software dev work basically spell out the schedule, the work contracted for (the more specific the better), the payment terms, and some other stuff like ownership of the completed product. The boilerplate in such contracts is mostly covered by law anyway. Disputes will go to mediation automatically in most states and you will then find that the exact wording of the contract may not matter much — mediators usually try to start with the original intent. I’ve never had these problems myself but I know other freelancers who have, they are always civil breach of contract suits where the customer alleges the developer failed to deliver, and/or the developer claims they didn’t get paid. Mediators tend to split the difference, lots of time gets wasted and money spent on lawyers. You want to avoid these situations rather than try to come up with an ironclad contract. If you get into a dispute with a customer you’ve already lost.

Don’t work for customers you get a bad feeling about. Don’t work for customers who ask for ridiculous or sketchy things (“I want an eBay clone for $5,000”). If you don’t feel you can trust someone don’t work with them. Don’t work for free unless you have a good reason (getting your foot in the door is probably not a good reason). Don’t work on spec. Most of all don’t get yourself into a situation where the customer owes you a lot of money (“a lot” meaning you would sue to get paid), or where the customer has given you a lot of money up-front (“a lot” meaning they will sue if you don’t deliver).

I avoid big vague green-fields projects unless I already know the customer. I work with the customer to define the scope and requirements and break the project into specific deliverables I can estimate reliably, then charge for each deliverable. I charge for the time we spend nailing down requirements. Until I feel I have a good understanding of the project and can break it down to tasks I can attach estimates to I don’t begin work. I do charge the customer for my analysis time. This approach means I’m never building up big receivables and my customer is not paying a lot in advance. I iterate on the deliverables, my customer sees frequent progress, I get paid as I deliver something tangible, the project doesn’t get derailed and no one is pissed off months down the road.

The best way to find customers (not gigs, unless you want the constant churn of piecework on Upwork, Fiverr, etc., which is mostly a waste of time) is through word of mouth and your professional network and contacts. You can also find customers through recruiters and job postings. Many jobs posted looking for f/t people represent opportunities for a freelancer/contractor, especially with smaller less-sexy companies that struggle to attract and hire anyone. You can’t be shy, you have to sell yourself as someone who can solve business problems. Unless you like to churn your customers and rack up lots of non-billable hours looking for gigs, focus on cultivating a handful of customers who give you steady work. Choose a niche or vertical that you can make a name in. Ask your satisfied customers to recommend you to their network.

I have worked through an agency since 2014, they take care of marketing, contracts, billing, payment, and some customer service for me, for a 15% cut of my gross. They usually get better rates than I was getting through my own negotiating skills so it works out. You might want to look into that.

I have some articles about freelancing on my web site typicalprogrammer.com (free, no ads or affiliate links or pop-ups).

Good luck.