1. Organization, I know this sounds stupid but planning out schedules and when you want to complete assignments makes all the difference. Start every day with a to-do list and check off each item as you go. Try and keep left overs from the to-do list under 2/3 so you can be effective and cut down procrastination. This should help get your assignments in on time.
2. Day-dreaming and focus issues can be a sign of ADHD or any other behavioral disorders. I don't want to diagnose you over the internet but look into it.
3. Use the tools available to you. I'm assuming you do online school and even if you don't, when you get home use the internet to help you solve your problems. Quizlet, Photomath, Sparknotes, etc. Most teachers are lazy and just copy things already on the internet, you can easily find the answers with a Google search.
4. Use free tutoring services like youtube or khan academy to understand concepts that are unfamiliar to you.
I know it sounds like a lot but if you schedule properly and do it effectively, your grades will go up Inshallah. Remember to make dua because nothing is possible without Allah's help.