I stopped looking at Lemmy for a long time, up until yesterday, due to the content being really depressing. Reddit didn't hate society, capitalism, or really everything as much as the Lemmy users seem to. I might stop doomscrolling here again.
There's nothing to be gained by looking at bad news all the time. You must balance it with good news, if for nothing else than to stay informed. There are more positive communities on Lemmy: goodnews@kbin.social or upliftingnews@lemmy.world for example, but you're right negativity, doomerism and defeatism is prevalent on the platform and you absolutely should leave if you find it affecting your mental health.
Please take the time to visit at least some of those websites I linked via my first comment. It does wonders being reminded that the world isn't doom and gloom all the time like the media likes to pretend it is.
I think it depends on what communities you were in. I would say that the problem may rather be that Lemmy doesn't have enough communities around topics that are disconnected from the negative things of the world.