Fully agree with the other responses:
- Your mental state might not be related to the situation you are in. Make sure it is not nutrition, hormones or other stuff. Take that seriously, especially if there is a gradual onset you might not even notice
- Arrange things to make it interesting again: work part time, change the region, add biz jet freelancing to you portfolio
- Try the left seat. It is a completely different job. As an FO, I wouldn't have known, but the left seat is 100% more fun compared to being an FO.
... and if all these don't work, search pprune for career outside flying. There were a couple of interesting threads about it during COVID.
All the best!