Cost benefit analysis is important. But it's pretty clear the vast majority of excess deaths were covid related, because there's a very strong correlation between excess deaths and reported covid cases/deaths, even when you look at different states that had different peaks at different times, and no such correlation to other responses like different types of lockdowns. More delayed / indirect / long-term effects might be harder to measure though.
[1]https://www.axios.com/suicide-decreased-in-2020-pandemmic-me...