First, find something that you are good at, or really like, and do it to the extreme by yourself. For example, a friend of mine was very insecure in middle school and his academic performance was average. He can't compete with others in anything, so he feels inferior. Later, I found that I liked calligraphy very much, so I started with hard pen calligraphy and later practiced brush calligraphy. When his calligraphy surpasses most people, he will have something to show off with his calligraphy, and others will look at him with new eyes and slowly overcome this inferiority complex.
In fact, the reason for this situation is very simple. If you want others to respect you, you have to have something to respect. Find your own strengths and bring them to the extreme, instead of comparing them with others everywhere. Only in this way can a person's self-confidence be true.
Second, learn humor, don't simply accept your fate, make jokes with friends around you, sometimes others bully you, and you reply to him in a humorous way. Although it seems that you have suffered, in the eyes of others, your road may be more brilliant and more popular.
Third, the most fundamental problem is to change your cognitive structure. Read more books, especially some humanities books. Such people will have a more comprehensive and relatively positive world outlook. As the saying goes, such people are more temperamental.
In short, in fact, some people bully you, and many times it is really others' fault, but the fundamental problem lies in themselves. So, change yourself first.