Do not know the source / author (probably the words of a song or a poem).
But whatever the source, these are certainly insightful thoughts:
Happy moments, praise God
Difficult moments, seek God
Quiet moments, worship God
Painful moments, trust God
Every moment, thank God.
Think on these things and put them into practice.