It seems that I lost the capability of studying

In 2019-2022, my method of studying was pretty much hard focusing for two to three hours in a row, memorizing even the smallest details. I do understand that this method wasn't healthy at all, but it got me through most of my classes. However, in 2023, I started losing a lot of motivation, not only because of my bad studying habits, but also because of a couple personal problems that I've faced that year. Now in 2024, I've actually managed to put my mind in a better place with the help of close friends and family, which I am incredibly grateful for, but I lost a lot of motivation to study after that bad year, and I simply do not have the will to sit through most of my classes or even focus to do well in a single test. I'm not sure how common this is, so if you've already gone through this, what methods would you recommend me to actually get back on track?