The secret of maintaining a grateful heart is contentment.
Key #1 - Thank him daily!
Psalms 68:19 "Blessed be the Lord, who daily loadeth us with benefits..."
Key #2 - Thank him no matter what happens.
Philippians 4:11 "Not that I speak in respect of want: for I have learned, in whatsoever state I am, therewith to be content."
1 Timothy 6:6, 8 "But godliness with contentment is great gain.... And having food and raiment let us be therewith content."
Hebrews 13:5 "Let your conversation be without covetousness; and be content with such things as ye have: for he hath said, I will never leave thee, nor forsake thee..."