How do you keep on being grateful even with the difficult challenges of life?

Mr J.
I have been writing down what I’m grateful for lately and good things that happened during the day.
I re-read something that reminded me that I have to find meaning in my suffering and that has always helped me a lot. What have I gained from what has been happening? Where can I use this as an opportunity to improve as a person?
I try to start my day with a compassionate meditation.
I keep happy pictures and notes and good memories around.