I don't have a child, but I was one and my parents apparently did succeed with their approach (as I am currently studying for my PhD).
There were mainly two things they taught me:
1) It sounds old, but you do not learn for grades or earn grades for parents. You learn for life. You can show children, that sometimes you don't see the effect while you work, but in the long run you will. And also, learning teaches you to learn. You might not need the topic you are struggling with in later life, but you will need the ability to struggle and win.
2) Praise her when she does good in things she likes to do. This is how she will find her path in life. And of course, because she likes to do them, there will be plenty of options for you to praise her. Console her when she fails in something she does not like to do. She might need it, but instead of telling her "You need good grades! Work harder!" tell her "I have also failed sometimes. I know you hate this topic. We will try and make it more fun. You won't be alone in trying to master it against the odds." Especially in young age, learning still should be somewhat fun. (I actually try making learning fun even for the university students I teach. Because wanting to have fun never ends. And if you choose something for the rest of your life, you should be able to have at least some fun doing it.)