She can usually fall asleep but awakens in the night afraid. She says she doesnt feel safe in her house. She also says she worries about school because sometimes she cant get her work done "fast enough". She can do all the things she is suppost to do but has little self confidence and fears the teacher will "yell at her". I dont know what to tell her or how to make her feel better. It is breaking my heart.
Talk a lot to her. I know you already do that, but she needs to put her feelings into words. This way she will begin to self-diagnosis for the roots of those confidence issues. Everyone, specially girls, need to be able to talk their worries out of their chests.
Get everyone in the house involved. If she has siblings, constant teasing won't do much good. Her parents should be supportive also.
Show her what she already accomplished. Does she procrastinate when doing her work? If she broadens her view and see that she is capable, she will be more confident and lose less time worrying before tackling the workload.
Also, you need to get acquainted to the behavior of that teacher, and assess their relationship. Is your granddaughter's teacher stern, friendly? Do her fears have any foundation? How does he treat her classmates? Be warned that teachers (specially the abusive ones) are masters at hiding their stuff under scrutiny.
You should absolutely probe deeper into why she feels unsafe at home, as that's very disconcerting.
Regarding her relationship with her teacher and academics - I had a first grade teacher who was honestly the most negative and critical person I've ever met. For example, she would call her first grade students 'failures' for not coloring in their drawings 'properly', and she would yell unprovoked. It really made me miserable and messed with my entire world view for a month or two. Thankfully I had very supportive parents who I knew I could talk to. They immediately had me transferred to another class with a great teacher.
It's possible that one or both of these issues are the cause of her anxiety. I will certainly say that you are in a great position to get her to confide in you to determine the root cause. As she seems very concerned about disappointing others or not 'measuring up', you should be especially clear in letter her know that you will love and support her no matter what and that you want to help make things better.
Some of my kids went through phases like this, some didn't. I saw the same with friends and their kids. In fact, I do remember one such phase when I was a child. It came, made my parents struggle a bit helplessly, and it went. I have no idea where it came from and what it was.
I think this mostly isn't about the fears they experience, but something beneath that. Maybe the child truly realizes that there are indeed things to fear in the world, and needs to test that feeling. Maybe some other fear is underneath that she cannot voice, and that seeks an outlet this way. If so, you (and/or her parents) should try to get at that, finding the real cause of the problem.
What's making her feel unsafe in the house? Is she really slower than others? Do the teachers actually yell at her? If there's something behind that, it would be good if you could find it.
Yet, what I as a parent found helpful in such phases was the (universally helpful) advice to not to make this into a spectacle in front of the child: Keep calm. Be reassuring. Be comforting. Listen. Ask. Explain. Try to sooth the fears.
I remember my mother getting out the flashlight and the two of us looking under the wardrobe and into other dimly lit corners of my room before I went to bed. I got a small light in my room, and she left the door a bit ajar. And a month later all this wasn't necessary anymore. Interestingly, I remember no underlying fears, just the ones I was expressing. (Which doesn't mean there weren't any. But there was nothing I could have expressed myself.)
I remember one of my kids around the age of 4 or 5 being afraid of wolves. I blame Grimms' fairytales for this. (That was Germany, in the late 90s, where there were probably less than a dozen wolves in the wild which had come over the Polish border. There's a few more nowadays, but you will never even see them while hiking through the woods.) In the end I bought books about wolves, read about them, and explained to the child what I had learned. We talked about the role wild animals had at the time those fairytales were invented, and how they later got hunted into extinction. How dogs were bred from wolves. All that talk helped the child. (And it gave me a fascination for the creatures that lasts until today.) After a few weeks, the fears were gone. Again, we found no underlying cause.