Reaching a point when you monetize a piece of software is very important. Otherwise you are just goofing around on your computer. Much like if you play games in a small, local way (If you are an e-sports star, there are ways to make money).
The first way is the standard 9-5 job. While you are at the office, you write code for your company or for the clients of the company. You don't own the code you have written. At least not in the legal way. You are mostly stuck in a place where you should spend your time so you could get your salary. For a introvert profession like software development - there are some pros to this - actually meet people, talk in the real world, exchange opinions about software and the real world instantaneously, not with an endless chat that you must spend reading.
The second way is freelancing. It is similar to 9-5. You don't own the code you write. Mostly, with freelancing, you are working from home, so less social meetings. This could be for family people that, even needing to focus on work, will be around the loved ones. There is a little bit of freedom - when you'll do your work. But in the same time this could be viewed as hell, because sometimes tasks are urgent, you may work in night hours, and having no strict schedule may be stressful.
Another bad things is searching for clients, and getting paid. Usually the clients go deep into a feedback loop, requiring fixes, improvements, even small things (from their perspective) that will totally break all the code /or whatever work you do/. Another thing - once you're done, many, many times the payment comes few days, even few weeks, if the client is bad - even months later.
Another way to make money is to create a software product or a service. It may be downloaded or executed online even while you are sleeping. In this case, you are not giving the source code, you are giving the end result of your code - web site, product, etc, to another technical individual, or very often - to non-technical user.
There are several ways to get money in this path. The first is a subscription model - you give access to the users in timely manner when they have paid. Another way is one time purchase /license/ to use your product. Some times your product could be totally free. Then you could place ads on your site/app and get money from them. The ads can be:
- Incoming from a 3rd party service (intermediate) and placed on a specific area/time - like a banner, or a video ad on some specific action in an app or site.
- Contracted by you - and in this case you will have much more control on what the ad will be, and maybe, get a bigger percentage income compared to the first option. This depends on your ability to negotiate.
If your product or service is free and is Web 2.0 - a tool or a platform where normal people can create stuff (and give you the rights to own and use), You could create a platform where other people show their own ads on the users of the platforms. Based on the data that the normal people have shared, the ads could be very, very targeted. Obviously, there are not so many such successful companies - Google (that owns - the OS, the Browser, the Web Sites), Facebook, LinkedIn etc.
Other than creating code that you give, or host and serve yourself, there are ways to make money from individuals that wish to learn what you know. This is content selling model copied from the self-help and marketing individuals. For this you'll need to record some video tutorials, share some source code, some presentations, host them and give a membership access - to those that have paid you.
YouTube and Twitch are one semi-good way to do a mix of the above - share some tutorials and make the video platform show ads, or receive money based on views. In this case you should try to code with technology or language or framework that is popular, modern, trendy, otherwise no-one will watch you.
Something that I'm seeing in both gurus that sell content and You Tubers is the use of special words. Marketing is not just for the marketing people anymore. Fishy words are used everywhere - by everyone. Words like - interesting, innovative, cool, hack(er), pro(professional), business (not everything that is called business is actually business), passive income, poor, rich, free, million (who can be sure that such individuals make million(s) and are not just goofing around searching for fishes). Use of numbers is very popular, also framework and language comparisons, memes and all other types of content that are understood by the technical people and are trying to mess with them, so could make the part of the funnel.
Another way is to create modules for all kinds of software - for developers and even non-developers. You could create a plugin for your favorite IDE and offer it with a price. Others get on the chance that - WordPress is very popular CMS - and create - themes, Plug-ins and all kinds of extensions that improve and enhance it.
And there is an option to depend on donations. Wikipedia is one such web site. Patreon is another site where you could create something and wait for donations. If you are a no-name individual, you are mostly doomed to hunger, with an exception if you are very good at something trendy.
In the end you must realize that money is a psychological idea - a store of value - and it's not bound to the software - which is a tool. How to reach a lot of people with the software? Obviously very rare will be the cases when someone does it alone. How people around the world will become aware of your existence? You must become aware of a problem to many and you must be able to resolve it. Also, you MUST check if it is a real problem and not just in your head, by a lot of asking, MVP etc. The platforms, or tools or services, content mediums that others could use to create their own stuff for the end consumer are very popular because the attention is more valuable than the money, because it can generate income repeatedly. Solving existing problems of other people is more altruistic software development (even if it is in return of fee) than creating something totally new that may or may not help others. Who needs million cryptocurrencies, million CMSes, yet another framework or programming language. And in many cases they create new problems or just - it probably will have bigger learning curve. If you solved your own problems, are they a problem for others? Mostly not - especially to the non-technical guy down the street.