What does it mean to remember Allah and thank him?
“Allah Almighty says:
“Remember Me and I will remember you. Thank Me and do not be ungrateful ” (2: 152).
That is:
“Remember Me with your worship and obedience to Me, and then, I will remember you with My forgiveness and reward. Remember Me in times of blessings and abundance, and then, I will remember you in difficulties and trials. Thank Me for the obvious favors shown to you and do not be ungrateful, denying them and disobeying Me. And the one who obeyed Allah – he actually expressed his gratitude by this. And the one who disobeyed Him – showed unworthiness “
See at-Tafsiru-l-Vadikhu-l-Muyassar by Sheikh Muhammad Ali al-Sabuni, p. 58.