I'm an applied mathematician and have been working independently as a consultant for nine years now. I don't have all of the answers for you, but perhaps some of the following may help.

- Regarding retirement, those who run a business get access to a SEP IRA, which has a contribution limit higher than a 401k. It's safest to talk to an account when first starting off, but the IRS posts their rules here:

https://www.irs.gov/retirement-plans/retirement-plans-faqs-r...

Long story short, you can contribute the lesser of 25% of income or $61k. At a bare minimum, I contribute this amount to minimize my tax liability. The amount changes year by year and I wish I had more, but the gains have been fine. I just use index funds. Also, I have been told there is a way to convert the SEP into a 401k, which then has certain tricks such as being able to loan yourself money in order to smooth out your income if you can pay back the money within a certain time frame. I have not had to do this and, again, I would encourage a conversation with a good accountant. I mention this because there may be a way to use your retirement account to smooth out your income stream if your work tends to be of the feast or famine variety.

- Regarding clients, my experience was that the initial set of clients came from people who I knew needed help that I had met while working as an employee. From an ethical point of view, I do not believe in reaching out and attempting to setup a contract while still working for your employer. This may also be legally dubious. However, I do think a tasteful email after separating from the employer is reasonable modulo non-competes. If the work you do for them is good, they tend to bring you back for more work. They also tend to refer you out others. Professional organizations and meetings sort of works sometimes. It's a massive time sink. I've never been able to show up and land a contract one a one shot. It takes a lot of personal time. I've never had a cold call work.

- If you ever want to attempt a federal government contract like an SBIR, STTR, or BAA, it's essential to take a class from your local chapter of the National Contract Management Association (NCMA):

https://www.ncmahq.org/

This is a bias of mine. That said, I learned a lot about how to read and write contracts and my class was something like $200 and worth every penny. Ultimately, you could have a good proposal and have it screened out because it doesn't use the correct verbiage that the contracting people need to see. It's not worth the mistake, so just take the contracting class.

- Does it pay better? Hourly, yes. Overall, no. Lifestyle is better. Potential upside is better. Ultimately, I've never been able to put together enough contracts where I'd make more than what I believe I could make as an employee. That said, there's a balance between contract work and product development. The products, meaning software, intellectual property, and algorithms, can be used on contracts to pay the bills. However, they can potentially be monetized independently and sold as a product. Maybe that's licensing. Maybe that's a finished software product. Personally, this is the direction that I've been heading because it's not clear to me that pure consulting is the way to retirement. That said, the product development has been very important to me, so I have not focused solely on developing the consulting business.

Anyway, this isn't meant to be a comprehensive list of how to be successful. In truth I don't know, but I enjoy hearing stories from others on what worked for them. If anyone else has some experiences, I'd love to hear.