The righteous is the one who obeys all that Allah (swt) has commanded and refrains from all that He (swt) has forbidden.
مَفَازًا (attainment): Victory and safety from the Hell. Allah (swt) says:
﴾فَمَن زُحْزِحَ عَنِ النَّارِ وَأُدْخِلَ الْجَنَّةَ فَقَدْ فَازَ ۗ وَمَا الْحَيَاةُ الدُّنْيَا إِلَّا مَتَاعُ الْغُرُورِ ﴿
(…So he who is drawn away from the Fire and admitted to Paradise has attained [his desire]. And what is the life of this world except the enjoyment of delusion.) (Ali-Imran: 185)