As others have already said ... donations.
Something to keep in mind though is how cheap per user this whole thing can be.
Here's the admin of mastodon.world and lemmy.world outlining their financials: https://blog.mastodon.world/april-and-may-2023-financial-update
They're actually making money off of donations.
And if you look at the monthly costs (~500 Euro / month) and their Monthly Active Users (~35k), that turns out to be ~0.2 Euro per year. Without a need for profits, marketing, bloated features etc, the actual cost of social media per user per year is something we'd all be willing to pay (IMO).
Now obviously there aren't salaries in that calculation. Moderation, admin-ing etc are all done voluntarily AFAIK, just like sub-reddit mods were on Reddit. Though, again, if someone wants moderating/admin-ing to be a side hustle of some sort, we all don't need to donate much for there to be actual livable salaries (or supplementary salaries) in this kind of work. In fact, I think it'd be cool if social media went in that direction where organising popular and nice community spaces was just a thing you could do for a living with the skill and talent it requires being of recognised value.
Lemmy.world, as an instance, has 7 admins and 25k Monthly Active Users. If each donated $5 per year, that's ~17k per year for each admin. Not a full salary, but maybe not bad for a part-time side hustle!