Everyone Has Bad Days
Your spouse can not be your ray of sunshine every day! So there will be days that one, if not both of you, feel gloomy and are having a bad day - which is perfectly normal. In these cases understand that the other one is having a rough day and give them a pass. Tell your spouse that you don't feel good or you're having a bad day so that they understand and don't take your attitude personally.
By communicating that you're having a rough day, your significant other will understand that they need to "back-off" until you feel better.