Try going to your school’s career center - make an appointment and talk to a career counselor about your long term/post-grad goals.
It can be really hard to find focus or motivation when you only have a vague idea (or no idea) of what’s beyond all the academic work you’re doing. I’ve always struggled with this, and the only thing that’s helped is to start doing some post-grad planning. The plan can always change - that’s not the point - but it gives me something to look toward and reminds me that staying on track is important.