Gratitude consists of feeling grateful and being grateful.
In good times, it is easy to both feel and be grateful.
What about sadder moments? Feeling grateful in these times is tough, nearly impossible to be precise. It is independent of our control.
But being grateful is what one has control over all the time. You can choose to be grateful even if you don’t feel grateful. You may choose to be grateful to a sad moment for teaching you a lesson, or for letting you experience a part of being alive.