Honestly, unless you’re failing or getting close to failing, I wouldn’t worry about grades too much. Most colleges will be more likely to accept you if you take higher level courses and improve over the years, assuming you’re planning on going to college. If you don’t plan to go to college, then you’re employer won’t care about what grades you get, just what you do outside of classes. But if you do want to improve your grades regardless, then take frequent breaks if you aren’t already. Spend like 15 minutes playing video games or going outside, then go and study for a couple hours. This way you won’t have a positive feedback loop of: get frustrated, focus less, understand the material less, get more frustrated. Obviously complete all you’re homework since those alone tend to be huge in points. If you have the urge to check your phone, just check it as long as you aren’t spending too long on it. If GPA is a concern, then take higher level classes. They all cover the same material as the lower level classes, just move at a different speed, but have a higher weight on you’re GPA.
TL;DR: Don’t worry about the grades, but if you want to raise them, then just take frequent breaks to reset your mind and be able to focus more.