All of the suggestions so far are excellent. I would add another: Look for a study pal, male or preferably female. Find a classmate who seems happy, successful and relaxed. Approach her and compliment her, then ask if she would consider letting you study with her during study period or after school.
Alternatively, approach you teacher to see if she can recommend another student who might be willing to tutor you. You will of course need to get your parents approval to hire a tutor.
You are twelve years old and a female entering adolescence, which is a turbulent period physically and emotionally. I suspect that this is the main reason you are suddenly finding it hard to focus on homework. Your school nurse, if you have one, might be the best person to ask for advice. Alternatively, you could talk to your family doctor.
I agree that you need to seek out some help. Talk to your parents, the school counselor, or your teachers. Any of them may have suggestions regarding ways to help you focus. Also, is there something that is weighing heavily upon you. If there is, things which weigh this heavily upon a person can make the person unable to concentrate.
It is frustrating, but know that you are not alone. Many people are unable to focus. You simply need to have some suggestions so you can find the things which work for you.
It sounds like you're getting pretty frustrated! Here are some suggestions I give to my own students:
First, set up a study corner without any distractions (no phone, no internet, no siblings), just a cozy beanbag or whatever will make you feel comfortable. Give yourself an hour in there at the same time each day. If you need more time, take a break, then go back to it. Don't stay up late trying to study - it doesn't work.
Keep careful track of what you know and what you don't know. When you come across something you can't figure out, write it down to ask your teacher (or tutor, or parent, whatever).
I used to get dragged down by small mistakes on every math test, until I finally forced myself to go over the whole test a second time. Not just skimming - actually do the problems again. It's really hard to make yourself do it, since you just want to be done with the test, but remember that you're never done with the test...you're just showing what you know whenever a test comes along. If you take the time to go back and find the mistakes you know must be in there, you'll end up happier with the results. Maybe it takes you twice as long to finish a test, but you have the right to demonstrate your knowledge regardless of how long it takes, and your teacher should understand that.
Ask your questions here, too - usually by the time you write out a question, you can figure out how to do it, and if not, someone will help you out pretty quick.
Feel free to message me if you need more help.
Also check out the links for other tips on math problems and focusing.
You need to talk to a counselor at your school. You are not the only one who has these problems. They are common. The counselor will understand and offer helpful suggestions.