Prophet محمَّد ﷺ said:
“مَنْ أَحَبَّ أَنْ يُزَحْزَحَ عَنِ النَّارِ وَيُدْخَلَ الْجَنَّةَ فَلْتَأْتِهِ مَنِيَّتُهُ وَهُوَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ وَلْيَأْتِ النَّاسَ بِمَا يُحِبُّ أَنْ يُؤْتَى إِلَيْه”
(Related by Ibn Hibban & al-Bayhaqiyy).
It means:
“He who wishes to be moved away from Hellfire, and be admitted into Paradise, let him die believing in Allah & the Day of Judgement, & let him treat people in the way he would like to be treated.”