Allah the Most High says:
O you who have believed; upon you is yourselves. Those who have gone astray will not harm you when you have been guided. To Allah is your return all together; then He will inform you of what you use to do. [5:105]
Imaam As-Sa’dee’ (Rahimahullaah) says: Meaning; strive hard in rectifying and perfecting yourselves and enjoin upon yourselves upright behavior. Then if you do that the one which has gone astray from the straight path will not be able to harm you, and likewise he will not be guided to the true religion, but rather he will only harm himself.
However this does not mean that commanding the good and forbidding the evil will not harm the servant which leaves it off or is negligent. In fact an individual will not be truly guided except by performing that which is an obligation with regard to commanding the good and forbidding the evil. Yes; however if he is unable to disapprove the evil with his hand and tongue but does it with his heart, then the one that has went astray will not harm him.
((And to Allah is your return altogether)) meaning your return on the day of judgement , and your meeting in front of Allah. (( And He will inform you of that which you use to do)) meaning from the good and evil.