There is a fine line between appearing confident and being cocky. Don't confuse the two. It is not pleasant to be around those who are cocky or arrogant and excessively proud. Exuding a healthy dose of confidence with natural conviction, however, is attractive. How does one gain confidence? By doing good work that adds value.
My first job out of business school, the most junior person was always asked their point of view at group meetings and judged as to how they defended that hypothesis - with how much conviction or confidence did they express their opinion?
Confidence can be a self fulfilling prophecy as those without it may fail or not try because they lack it and those with it may succeed even more and therefore grow in confidence because they do possess it. Be careful not to get cocky with growing successes.
My now teenage son has grown more and more confident in his baseball after hours and hours of coaching, practicing, gameplay on his school team as well as on a year round travel team. Confidence that is natural and attractive is hard earned.
######
Marketing is not bragging, and touting one's products/services is not evil. The baker in the medieval town square had to holler 'fresh rolls' if he hoped to feed the township.
It's how you do it and the validation behind your claims that makes the difference between being confident or cocky.