First, you need to communicate with your mother. Tell her how you feel and let her know that you want to solve this problem as soon as possible instead of wearing diapers all day. You can tell her that you have grown up and want to deal with this problem yourself.
Secondly, you need to find out why you wet your pants at school. Is it because you are too nervous or because you don't have time to go to the bathroom? If it is the former, you can try some relaxation techniques, such as deep breathing and yoga, to help you stay calm when you are nervous. If it is the latter, you can try to go to the toilet in advance, or try to use the toilet between classes.
Third, you need to communicate with the teacher. Tell them about your situation and let them know that you are trying to solve this problem. They may give you some advice or help you when necessary.
Finally, you need to give yourself some time. Changing a habit is not an easy task, it takes time and patience. You may have some failures, but please don't lose heart. As long as you persist, you will be able to solve this problem.
Generally speaking, this is a problem that needs to be solved by itself. You need to face it bravely and don't be afraid of failure. Remember, everyone makes mistakes sometimes, and the key is to learn from them and make continuous progress.