On top of UBI that has been mentioned (and in true socialism - everyone's needs met beyond that, including housing, food, utilities, and so on), without capitalism the artificial "need" to "buy stuff" will no longer exist, so there's no problem.
One thing capitalism is great at is selling us "solutions" to problems it created itself.