Muaz bin Jabal reported,

The Messenger of Allah ﷺ passed by me while I was riding a donkey and said, "Muaz, do you know what right Allah has over His servants and what right the servants have over Allah?"I replied, "Allah and His Messenger know best."He said, "The right of Allah over His servants is that they worship Him and associate nothing with Him, and the right of the servants over Allah, if they do that, is that He will not punish them."

Ibn Majah 4296

Sahih

حدثنا محمد بن عبد الملك بن أبي الشوارب حدثنا أبو عوانة حدثنا عبد الملك بن عمير عن ابن أبي ليلى

عن معاذ بن جبل قال

مر بي رسول الله ﷺ وأنا على حمار فقال يا معاذ هل تدري ما حق الله على العباد وما حق العباد على الله قلت الله ورسوله أعلم قال فإن حق الله على العباد أن يعبدوه ولا يشركوا به شيئا وحق العباد على الله إذا فعلوا ذلك أن لا يعذبهم

ابن ماجه 4296صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Asceticism
Chapter
What is hoped for from the mercy of Allah on the Day of Resurrection
Numbering
Darussalam 4296
Ibn Majah 4296