- Obtaining funding from government/companies for doing research.
This would not usually give the researcher more money, except in the long-term indirect sense of advancing their academic career and helping to get a promotion. Research grants are paid to the university employing the researcher and they will generally pay some or all of the salary of the researcher. The academic does not get money directly from this --- instead, the university takes the money and uses it to subsidise the salary costs of the researchers on the grant. (There are some exceptions to this, such as direct summer salaries in the US.)
Of course, if a researcher wins a major grant, this can be used to make a case for promotion from the university, and it can therefore lead to an indirect wage raise for the academic in question. For a researcher who is not already a full professor, winning a major research grant will usually lead to a promotion and consequent pay raise, though the pay raise is modest relative to the amount of the grant.
- Forming their own consultancy firms or doing freelance consultancy for external entities.
Many academics have strong technical expertise in areas that are useful to external entities, and some make money from external consulting work. Universities sometimes even allow academics to engage in external consulting work as a portion of their work time, which means that some academics can make money from consulting work within their ordinary academic hours.
Though I do not have data on this kind of work, my observation is that only a small proportion of academics do external consulting work outside their regular academic job. Even for those that do this, the income is highly skewed --- most academics who do external consulting earn a modest amount of money from this (substantially less than their academic salary) but a few make big money. In my observation the latter are mostly academics who work in economics/finance and moonlight working for big finance companies, or engineers doing work for big-name industrial firms.
What other viable sources do they have for earning money?
Other avenues relating to academic work are writing textbooks or popular books, creating blogs/websites/YouTube channels, etc. Again, only a relatively small number of academics earn any serious money doing this, but a few manage to make big money. Beyond these items, academics can of course apply for second jobs just like anyone else, but this is rare, since academic work tends to bleed into weekends and holidays already.