Srila Bhakti Siddhant Sarasvati Gosvami Thakur Prabhupad would say that,
When people will think that their position is better than yours, they will criticize you in many ways.
It would be wise to have humility better than a blade of grass and tolerance much more than a tree. In addition, try to stay devoid of self-pride while always respecting others. When you will inculcate these four qualities in your life, then only your conduct will become pure and ideal.
Remembering the words of Bonfide Guru and authentic scriptures will enable you not to repeat any mistakes.
Even after attaining all this in perfection, if someone continues to condemn out of ignorance, then it would be good to inform them politely, the truth behind your actions.
It will benefit both of you.