I want the other characters to contradict his world view and try to take him down like in "Fresh prince of bel air" and "South Park".
I haven't a clue about the examples you provided but I think I know what you're asking. IRL people with overinflated egos tend to have personality quirks that are often hilarious. I'm thinking of one person who things thinks (s)he is the be-all end-all of all things military. That individual left me a voicemail threatening to call my youngest's "General." Problem is, the US Navy doesn't have Generals. They're Admirals. Give your character a personality quirk that results in errors obvious to everyone but the character. Then work it! ETA: That same individual in the same voicemail sonorously informed me, "this call is being recorded." No, really? </sarc> It's a voicemail!
Ah, you're reminding me of one of my favorite characters: Ignatius J Reilly (from Confederacy of Dunces) What's so funny about him is the drastic difference between his lifestyle/actions and how he talks. He is very dramatic. It's been a while since I read the book but I'll offer examples as I remember them. He fancies himself a tortured genius not understood by others (which he may very well be, who knows) yet is a very large adult man doing nothing but lazing around being cared for by his mother. Often he'll start screaming about his "faulty valve" (some made up ailment he has) causing him immense pain if his mother attempts to get him to get out of bed. When he does work, he figures he can do everything better and precedes to mess everything up. When he's yelled at for his mess ups he is completely surprised and aghast (this is the response i get for helping you!). Complete, hilarious delusion on his part. I think it's important for the character to have obvious flaws (incompetence, sloth, inability to control urges [Ignatius eats his entire cart of hot dogs he was suppose to sell]).
I also do not understand either reference. I'm assuming you're saying Will had a big ego? He did, but I don't recall him ever really getting called out on it, and he was certainly self-aware of his own shortcomings (school for example.) Also, South Park... you mean Cartman? I don't find these characters very funny, if I'd use a word for them, I'd use "cringy." I think they're only funny in situations where the cringe is part of what's supposed to be funny. To me, the times that they are funniest is when they are confidently talking out of their ass in a way that they think they're projecting one thing, when in fact, their ignorance is on clear display. I also find it funny when people brag about things that are completely untrue and not anything worth bragging about. Sort of like saying "I got people coming up to me all the time telling me how great my hands are." Really president tiny hands... have people really done that? I have small hands too, who gives a fuck, why even lie about that? You could also put people in situations where they act tough, but get called out. That tends to be funny. There's a meme across the internet that goes "everyone is gangsta until the roach starts flying." and it's true.
Not called out as such but Douglas Adams' Zaphod Beeblebrox is very funny had a pretty big ego, as demonstrated by "if there's anything more important than my ego around here, I want it caught and shot"
I've never watched South Park or Fresh Prince. The only character I can think of with a big ego was in Two Weeks Notice - George played by Hugh Grant. He managed to be lovable while being arrogant. I think pairing is key. When you have a bit of a goof you need the straight man to play off of him. Sandra Bullock was the perfect foil for Hugh Grant. I think if you give your mc a good 'straight' man or woman to play off of and occasionally get the best of him and or vice versa it could lighten his attitude and make it more playful or set ups for jokes.
Fresh Prince Will tells a woman that she has the privilege to date the prince of bel air. She asks who he thinks he is and takes him down. His confidence remains unaffected. South Park Cartman as the coon tells a story about how hard it is to be a hero, then beats up random innocent people scolding him.
Have him be over the top but harmless. Or give him an frenemy/minion who will snark at him whenever he pulls this.
I think for Fresh Prince, there is an element of the character having to "deserve" their ego to some degree. For ex. Will is very quick witted and charasmatic so the audience can understand why he feels confident. His wit and charm may not be proportionate to his ego but there has to be something there for the audience to "rationalize" his behavior which builds anticipation when he pursues a love interest - there is the anticipation of would she/won't she - so when he gets taken down, it releases that tension which induces laughter.
This may sound strange, but when I want to inject comedy into the failings of a character with a big ego, I think of cat blooper videos. Cats have huge egos and hate to be embarrassed...and they're absolutely hilarious when they mess up. When cats do something clumsy, they'll often immediately look around to see if anyone else is watching. Or they'll try to pull off the classic, "I meant to do that." Their reactions to potential embarrassment are easily translated into human emotions and reactions, so they're good inspiration.