Hi!! Sorry for taking so long to answer!! But I think the first thing you should do is to identify what is making you hate school. Is it a teacher, a class, the amount of homework or something else?
I personally think that it can be solved by the way you think about it. So, for example, if you hate maths class and you keep telling yourself “I HATE maths” you will go to the class with this mentality and it WILL be horrible because in your head everything related to maths sucks. So, what you have to do is get rid of all those thoughts and try to motivate yourself somehow. Maybe tell yourself maths class won’t be horrible because you’re learning new things and learning is always good for you because it helps you grow as a person. Don’t think about it as a waste of time, try to see the bright side.
If it’s about too much homework then what you have to do is organise yourself better. Try to start your homework earlier, you have to stop procrastinating and just start. Once you start it’s easy to keep going.
To get organised I suggest you use a study schedule (here's how to make one) and to do lists.