Here's how to solve school refusal in 3 steps. First, assess why your child is refusing to go to school by asking them about what is challenging about school, what is easy, etc. Second, work with your child to set goals and work backward and create incremental steps. For example, if your goal is to attend a full day of school, you might work backward and set goals of attending a half day, attending one class, visiting the office, and visiting the parking lot. Finally, work through your step-by-step plan and adjust as you better understand what specifically about attending school is difficult for your child, which could range from social anxiety to the fear of illness and many more.
I don't have an answer as much as a suggestion. As someone who struggled to go to school I would just say that approaching this with empathy rather than brute force can be life changing. Understand and support.
It depends entirely on why your child is refusing to go to school. This site provides an assessment to help you dive into the root cause here.