There are people who look for this attention. For example, I need to be reassurance and be validated by people who are important for me.
I’m not saying that it’s your case. Normally, a person who seeks or needs to call the attention (I had kids in my school who did it), they are trying to say something or it’s for a reason. They don’t mean it for the sake of calling the attention, they are expressing a need or a lack but for people outside, it’s gonna be perceived as seeking attention.
You may question about the non-existence or, the existence of this mechanism in yourself and in case, it exists in a dysfunctional or stressing degree (bc everyone need some level of acceptance and validation, we are human and social animals). So if it exist as that, stressing for you and others, you will have to work on the why and what to do to counteract it in a healthy way.