All children (and adults) have bad days. This is to be expected.
If your child is acting out or seems upset, reflect what you are seeing with responses like, "You seem upset, do you want to talk about how you are feeling?" or "I heard you yelling at your brother, did something happen at school today?"
Then, really listen to your child's experience and feelings before trying to make them feel better. Responses like, "That does sound challenging," or "I'm sorry that happened to you," lets your child know that you recognize the difficulty of what they experienced.
Praise children when they tell you about their feelings or negative experiences. Using phrases such as, "It's great you could tell me about that," or "Thank you for sharing that with me," sends the message that you welcome all of their feelings and experiences, not just the 'good' ones.
Once you've listened to what your child has to say, help them to navigate towards feeling better by offering your relationship. For example, invite your child to make dinner with you, snuggle on the couch, or play a game together. For younger children you can offer choices, but encourage your child to choose an activity that brings you both closer together, rather than an activity that isolates them, such as playing video games in their room.
Keep track of patterns in what may cause a bad day to help prevent them in the future. Some examples may be going to bed too late causing them to be tired the next day, getting a bad grade on a test, or forgetting to bring assignments to school.