Consider your child to be a sponge. Sponges don't soak up some things and not other things. Sponges soak up any liquid it with which it comes into contact. Your words are the liquid to your child's sponge. When my daughter was six years old, she was showing attitude and I said, "Rachel, don't be smart!" And then I thought, do I really not want her to be smart? Thankfully, I caught the error in my words and corrected the situation.
When your child is hurting, give her words of comfort and understanding. Use active listening, or empathy, as a communication tool to zero in on what you think she is feeling. Active listening is the balm that soothes the pain of your emotionally hurting child. Don't give her solutions to her problem, as giving solutions conveys the message, you can't figure this out, so I'll do it for you. Such a hidden message conveys both emotional distance and dependency. Don't be critical of their efforts in a misguided mission to give them an educational experience. If you do this, they will be less likely to come to you in the future. Finally, don't minimize your child's efforts to fix the situation. Don't make it about you. It's about her, her feelings, and her efforts to come to terms with what's going on at that moment in her life. Active listening is the best communication tool to affirm, pace, and validate your child. What you say to your child matters. Choose your words wisely.