Do what is correct and avoid the incorrect
Harmala ibn 'Abdullah, may Allah be pleased with him, went to the Prophet, may the peace and blessings of Allah be upon him, and stayed with him until the Prophet, may the peace and blessings of Allah be upon him, recognized him. He said, "When we set out, I told myself, 'By Allah, I will go to the Prophet so that I will have more knowledge. I went in the evening until I was in front of him. I asked, 'What do you command me to do?' He replied, 'Harmala, do what is correct and avoid the incorrect.' Then I went back to the caravan. Then I came back again until I was in my place near him. I asked, ' O Messenger of Allah, what do you command me to do?' He replied, 'Harmala, do what is correct and avoid the incorrect. Find out what you like to hear people tell you when you are with them. When you leave me, behave in that manner. Find out what you dislike for people to say to you. When you leave me, avoid that.' When I returned, I thought that these two statements did not omit anything."
The chain of narrators of this Hadith is weak.
The saying of the Messenger of Allah ( may the peace and blessings of Allah be upon him ) : ( do what is correct ) entails to know what is good, to do it, to maintain doing it and to call others to do it, in addition to all these correct meanings.
What is correct is that: which is approved by the Sharia and the mind recommended it accordingly, then the righteous souls find rest in it and the hearts of believers are reassured to it.
As for his saying – may the peace and blessings of Allah be upon him -: "Avoid the incorrect" entails: to make oneself distant from it and to keep away from every thing that may lead to it.
In conclusion: the wise is the one who admonishes himself, takes lessons from what happens to the others, and reflects upon what he sees and hear, if he sees the good results in a matter, he would do it. Otherwise, he would avoid it. The goodness lies in knowing the path of both good and evil so that one acts only when he is assured of the good consequences.
It is noteworthy that the greatest thing one obtains after faith is the wisdom that lets one acts and speaks according to the requirements of the wisdom.