I've been consulting since 1995, and have been co-hosting the Freelancers Show podcast (https://devchat.tv/freelancers/) for about 5 years now. If I could distill all of the advice I've given (and received) over those years, it would come down to a few things:

(1) Consulting means running a business. This requires a different set of skills, and often different thinking, than you have as a developer. You'll have to learn budgeting and marketing, among other things. Learn these skills, and realize that for as long as you consult, you'll need to improve at them.

(2) There are many different types of consulting. I personally do Python training, and love it. But many consultants do what's sometimes called "staff augmentation," working as a contractor on gigs that can last one day to one year. Staff augmentation is the way that most people start off, and it's not inherently bad -- but you can make far more money, and have more influence and satisfaction, by providing insights and value from your experience and knowledge. And yes, this often means that you can make more money diagnosing problems and architecting solutions than actually developing the software that solves the problem. Also, the higher the level at which you're working at a company, the more you can make; helping a team leader is better than helping a programmer, but helping a VP is better than a team leader, and helping the CEO is better yet, still.

(3) Don't forget to budget, and to put money away for a rainy day and for retirement. You should probably have a runway of 6-8 months before starting to freelance, just because it takes time to find clients.

(4) Specialize. You want to be the big fish in a small pond, rather than the reverse. There are lots of Python consultants out there. But there are many fewer who teach courses, fewer yet who do it full time, and and even fewer who talk about themselves nonstop as trainers. So companies call me, because the problem that they have -- employees who don't know Python -- is one that they instantly understand I can solve. Specializing means that most people will ignore you, because you don't solve their problems. But for those whose problems you can solve, you'll fit perfectly. Philip Morgan has a great book and podcast on this topic.

(5) Get your name out: Write a newsletter, blog, speak at meetups and conferences, and let people know (nonstop!) who you are, and what you do. It'll take time -- in my case, it took years -- but having such a constant presence, online and off, will lead people to remember you and ask you for help.

(6) Think about how you want to bill. Many do hourly, but it's better to do daily, even better to do weekly, and better yet to do value-based pricing, in which you charge according to the value that the client is getting. Jonathan Stark writes a lot about this. You'll likely experiment a bit with billing tactics.

(7) You'll have bad clients. Companies will be mean to you. They'll stiff you. They'll say it's your fault. This is all rather unpleasant; overall, I've only had a handful of such clients, but they stick out in my mind. Learning to say "no" to clients, and to have the right gut feeling about them, takes... well, the length of a career.

(8) If you play your cards right, you'll make more money than your salaried counterparts, without too much less stability. Moreover, you'll be able to set your own schedule. When things work well, they work really well, and gives you a sense of independence and fulfillment that wouldn't be possible in a full-time "real" job. The thought that I've paid off my mortgage, paid for family vacations, and still have savings... well, I kinda marvel at it, even now. But if I can do it, then so can you.

(9) Finally: Consulting isn't for everyone. You might decide that it's too hard, or that it doesn't suit your personality, or that you haven't found the right niche. That's totally OK. If you want to go half-way, you can work as a consultant for an outsourcing agency, which doesn't pay as much but gives you the variety and flexibility of consulting. But if you end up hating freelancing, and going back to a "real" job.... that's totally normal and reasonable, and you shouldn't feel like a failure if that happens.

Be sure to read Brennan Dunn's "Double Your Freelancing" stuff (https://doubleyourfreelancing.com/) and Patrick McKenzie's extensive and inspirational writings (https://www.kalzumeus.com/greatest-hits/).

Best of luck!