The Rebbe's guidance on recognizing G-d's kindness and giving thanks for it:
See the good you already have. Someone who claims never to have seen good, or to have "no mazel," is asked to look at the children and the peaceful life he has been given; gratitude for these is essential for continued blessing (IK 3172, 4090). Even amid difficulties, recognize the blessings already received and keep a positive outlook, trusting that more good will follow (IK 4515, 4622, 4908). Beginning each day with gratitude shapes one's outlook and brings joy (IK 3967). It is a mistake to think one should not show satisfaction with how G-d runs the world; the Torah asks for service with joy and gratitude (IK 3706).
After a miracle or salvation. Recognize open miracles and don't ignore G-d's kindness (IK 6639). Thank G-d first, before voicing complaints about other matters (IK 2352). When a request is answered, respond with joy and gratitude, not with needless brokenness (IK 2451). The way to thank G-d is the way He desires — by adding in Torah and mitzvos, beyond one's natural limits, and influencing one's surroundings (IK 1446, 2637, 4718, 5349). Taking blessings for granted can hold back further blessing (IK 5349). Expressing thanks, as at a thanksgiving meal, is itself a sign of full recovery (IK 6742); study Mizmor LeTodah in depth (IK 3849). Have you recognized G-d's kindness in your affairs, and thanked Him? (IK 10504). Chanukah is a time of praise and thanks for miracles (IK 9063).
Gratitude to people. When urgent practical matters involve those to whom one owes gratitude, repay them before turning to abstract debates (IK 10628). Gratitude for past kindness goes together with faith and trust for the future (IK 694).
See also: Bitachon – What trust in G-d means: think good and it will be good; Bitachon – Joy and overcoming sadness; Bitachon – Receiving a blessing: making a vessel for it.