everyone learns differently and its important to figure out how you learn best. I was pretty bad at focusing for a while, I then got rid of all social media except for youtube, starting taking care of my body (gym, diet, creatine!), and went back to hobbies that grew my brain (for me this is playing chess, crocheting with my girlfriend, and playing ranked i suppose). if you put effort into taking care of your brain, it will help you out in return.
or just see if you have adhd. no shame in taking meds. not all brains structured in a way where it is easy to function in a neuro-typical society. I have autism and have to accommodate myself in a range of ways so i can succeed. and i have succeeded so far.