Does bragging about one's good qualities or achievements make us confident? Definitely not! In fact, mindless boasting of your abilities means you are not confident. There is a line between confidence and ego, and we often get confused between the two. To start with, they are definitely not the same. Let me show you how they are different.
What do you think when you mess up something? Your egoistic mind will not admit you are wrong or that you caused damage to others. Your ego wants to maintain its hero image, and a hero can never go wrong. Also, you are afraid of looking bad because you care about what others think of you--a flawless hero. In self-defense, you never accept your mistake; you blame others. Basically, you avoid challenges and learning because you want to protect that big god-like image of yours.
But if you are confident, you will say, "It's okay to make mistakes and learn. Let me see where I went wrong and improve myself!" This happens because you are not delusional about your own reality. You know about your skills and are also aware of your flaws. You are not scared of what people think of you and can show your vulnerabilities in front of others.
In a nutshell, ego is all about showing off, while confidence is about knowing your strengths and working on your weaknesses. So next time, boast your confidence without the fake hero bubble!