A long time ago the government passed laws to make sure that every one receives an education. The idea was to give every one an equal chance in life (as much as possible) and to prepare children to be useful people in the community.
These days you don't have to go to school to receive an education. If your parent(s) want to they can make arrangements for you to learn at home.
But most families find it convenient for their kids to go to school to learn the sorts of things that they need to enjoy their life now--and in the future. This includes being able to get a job when you're grown up, of course.
If you do go to school but you don't enjoy it then it would be a good idea to talk about your feelings and thoughts with your parents and your teachers.
School should not be boring. It should be fun and interesting.
That doesn't mean that school will always be easy.
Some things are hard to learn and some things take a long time to learn or to do. It is good to know what it is like to spend a lot of time and effort finishing a difficult project or learning something that doesn't come easily. It will develop your patience, your organising and planning skills and your confidence. It will give you great pleasure to know that you have achieved something special.
And sometimes even failure is a good thing. It reminds us that we aren't perfect and we need help. Perhaps we need to 'try, try again'.
But research shows that people learn best when they see a purpose in what they are learning and when they enjoy it.
If neither of these applies to you then talk to someone about it soon!