If I, for example, wanted to make a Spongebob game and was not asked to to do so by the company that owns the character, what would I have to do in order to get the rights to make the game?
Most often, you don't.
Game licensing is often a "don't call us, we'll call you" sort of affair.
If the owner of the intellectual property hasn't already decided they want a new game made with it, and started seeking out developers to do so, they're unlikely to be moved to do so by a random request out of left field.
You don't know the company's internal plans. They might be deliberately taking a break from games using the IP to avoid franchise fatigue. They might be targeting different regions, audiences, or platforms than you have in mind. They might already have another studio working on a game that's currently unannounced. They might have already signed an exclusivity deal for the video game rights that won't free up in the near future, even if no games are currently being made. So unless they come to you first, you have no evidence that a deal is even in the realm of possibility.
You're even less likely to secure such a deal if you're an unknown developer without a proven track record of high-quality, top-selling games to give them confidence you're a sound investment to make with their IP.
So, the best thing you can do is make your own original games, or work-for-hire contracts responding to IP owners who publish a request for proposals or contact you directly.
Once you have an established portfolio of high-quality work in a similar area, you have a much better chance of being contacted to work on the kinds of games you're interested in, or getting past the front door if you want to go out on a limb and pitch a game no one asked you for.