There are lots of options apart from the standard salaried career. At the age of 39 I'd had enough for working for other people and started my own bootstrapped 1-man company, selling software products online. I am still at it 16 years later.
I built products that I wanted. That probably isn't a commercially optimal approach.
Probably better commercially to pick a market, embed yourself in that market and learn what they want. You might end up building something you are less interested in though.
>Did you stick to the same business domain, learned about their problems, and then built a product?
I have 3 products now. In each case I released something bare-bones that I thought was useful then iterated like crazy on user feedback. I didn't know that much about each domain when I started (but I do now!).
If you are interested I've written quite a bit about my experiences at: https://www.successfulsoftware.net