Parashas Yisro · Passuk 20:20
Chabad.org — English translation + Rashi
Torah Temimah points to Mechilta (verified).
Sefaria — Exodus 20:20
Sefaria — Mechilta
English: Rabbi Akiva says: Do not act toward Me as others act — when good comes upon them they honor their gods, and when evil comes they curse them; but you, whether in good or in evil, shall give thanks.
In context: See the cited source for the full section.
Derash on the verse.
Yisrael is commanded to respond to both prosperity and adversity with the same acknowledgment of God.