What is wrong with you

I caught myself saying this to someone ‘what is wrong with you?’ and later, when I was thinking back to the conversation we had, I asked myself apart from making the other person feel bad, what was the point for saying that?
Hopefully next time I will catch myself before uttering that sentence out. To more self-control in the future.