If the person with the bad attitude is indeed an unconverted person then any attempt to improve their attitude by pointing it our to them will most likely result in an even worse attitude. Prayer and fasting will be very effective in this instance. If the person is a Christian who is out of balance spiritually, and not embraced the fullness of what it means to live for Christ, some instruction may help them. And they did not receive him, because his face was as though he would go to Jerusalem. But when Peter was come to Antioch, I withstood him to the face, because he was to be blamed.
Attitudes are contagious and even great people can develop an attitude that's hurtful to the church.
The Apostle John and James did. Now the Apostle Peter has developed a hurtful attitude and it goes on to effect other believing Jews and even Barnabas, the son of consolation. Paul had a talk with Peter that seemed to help. It appears that he pointed out to Peter what he was doing. I imagine that Peter and Barnabas were ashamed and repentant when they realized what they had done.