Since Prophet Adam (AS) came to the earth up until now, all people have been facing this challenge.
The issue of good and evil, or virtue and vice, has been a point of discussion among philosophers, theologians and thinkers throughout history.
While debating different aspects of this issue, they arrived at important conclusions about God and theology.
Khayr (good, virtue) refers to a phenomenon that brings about positive outcomes and fulfils one’s material or spiritual needs. All the good things are from God, both those directly coming from God- like a peace of mind that one feels when remembering God)- and others.
Shar (bad, vice) refers to a phenomenon that usually does not bring good results for people.
Shar is among issues about whose origin there have been many debates.
As God is absolute good and whatever He does is based on Hikma (wisdom) and knowledge, one cannot attribute Shar to God.
Now the question is how we can distinguish Kkayr and Shar from one another and how we can recognize them in the world.
Imam Ali (AS) answers this question in Sermon 167 of Nahj al-Balagha:
“Allah, the Glorified, has sent down a guiding Book (the Holy Quran) wherein He has explained virtue and vice. You should adopt the course of virtue whereby you will have guidance, and keep aloof from the direction of vice so that you remain on the right way.”