In the US primary energy from fossil fuel consumption was higher in 2007 than it was in 2022: 85.78 quads in 2007, 79.102 quads in 2022.
Production is unfortunately still rising because fuel exports provide an outlet for production that isn't consumed domestically.
Are you talking worldwide? Or in the US? Because in the US and many other advanced economies total energy consumption is still increasing, but the total amount from fossil fuels is shrinking.
At a certain point it is going to no longer make economic sense to continue to build new fossil fuel based energy production (it already doesn't if externalities are accounted for).
It is a big hill to climb, but as the saying goes, "people vote with their wallets". Economic forces are pretty hard to resist.