My husband is good at knowing when I am in a bad mood.
"My husband is good at knowing"=「私の夫は知ることが上手です」
"when I am in a bad mood"=「私が不機嫌であるとき」
Sentence in context:
"I am really helped by my husband who is very perceptive and knows when I am tired or in a bad mood. He then takes out the children to the nearby park."