God says in Verse 21 of Surah Al-Baqarah: “O people, worship your Lord who has created you and those who have gone before you, so that you will be cautious.”
We also read in Surah Al-Kawthar, “(Muhammad), We have granted you abundant virtue. So pray to your Lord and sacrifice.” (Verses 1-2)
So God tells the Holy Prophet (PBUH) to say prayers as a sign of thankfulness for what he has been granted.
Salah is the best way of thanking God and God has told us how to perform Salah.
All divine prophets and virtuous figures in history have used prayers to show their gratefulness to God.
Salah is a practical, constant and constructive way of thanking God.