Al-Imam Ali (p.b.u.h), said:
Hadith n. 94
Amir al-mu’minin, peace be upon him, said: He was asked what is good and he replied: Good is not that your wealth and progeny should be much, but good is that your knowledge should be much, your forbearance should be great, and that you should vie with other people in worship of Allah. If you do good deeds you thank Allah, but if you commit evil you seek forgiveness of Allah. In this world, good is for two persons only; the man who commits sins but rectifies them by repentance; and the man who hastens towards good actions.
Hadith n. 95
Amir al-mu’minin, peace be upon him, said: Action accompanied by fear for Allah does not fail, and how can a thing fail that has been accepted.
Source: https://www.al-islam.org/nahjul-balagha-part-2-letters-and-sayings