I think it depends solely upon your relationship with that person.
With my husband, I usually confront the issue right away. It is good for maintaining peace at home to talk out the issue and work at a solution.
If it’s a friend, the approach will depend on how old and strong is our friendship. With my old friends, I can point out things that bother me about their attitude and so can they. With a casual acquaintance, I just swallow it and don’t react at all.
The tricky part is when it is one of my children. With them, I am careful and broach the topic if I feel they are in a frame of mind to listen and respond positively. Otherwise, I will wait for an appropriate time.
Peace of mind is important and people can spoil it for us by doing or saying things without thinking them through. But sometimes holding the tongue can be more peaceful. One has to choose one’s battles!