I think humor is more of an author trait and signature than something to necessarily craft or hone. If you're a naturally humorous person, as in funnier than fart jokes, then you can fit it into almost any narrative. Horror media often plays with the humiliating, ironic, absurd, and down right ridiculous, allowing the audience to laugh through terror. That's high-level.
Humor is a hard trait to teach, and while it's linked to writing structurally, it's very much it's own "talent." Assuming just turning into a comedian is insurmountable (because everyone can't have every talent,) then the real difficulty lies in reeling it in. There's a reason that tragedy and comedy have been linked for so long. I just don't have the necessary degree to explain it. Irony is a literary tool that lends itself to comedy. They're the same DNA, a subversion of expectations, which most humor is. We laugh either because we're surprised, or because we're in on the joke. As most comedians would admit, jokes aren't usually funny if they have to be explained, and I think that's the key to using humor in your narrative. Let the reader discover the humor for themselves.
Literature isn't like stand-up comedy where laughing with your audience can create a self-fulfilling feedback loop. You aren't there to change your face, or tone, or even control the pacing of your delivery, though you can certainly maximize your efforts via the prose. You readers will be alone, and focused solely on your narrative. I'm thinking of GRRM a lot today, but he's a masterclass in sneaking humor into the subtext. So many deaths are utterly humiliating, but the characters never laugh, and the narrative rarely lingers on it. A reader, viewer, or consumer has the safe harbor of reality to take a moment, reread, and laugh.
Of course, if you're explicitly writing comedy, the rules are entirely different. Then you have to worry about burnout on both ends. Many children's books keep the comedy at a 10, because, well, children. You have to work a lot harder to entertain adults that have already heard all the low-brow humor. Even raw comedy, stand-up, slapstick, usually has to step away from the comedy temporarily, because a lot of things are only funny because the situation is NOT funny. If you've never watched Curb Your Enthusiasm, or King of The Hill, both are very "boring" shows, and their comedy relies entirely on piercing through the mundane reality that is real life. If you watch them while browsing your phone, you won't get it, but if you really pay attention, the same way a reader is forced to pay attention to the book, they're some of the funniest shows ever.
Going full circle though, I don't think many people dedicate time to trying to be funny, at least as an adult. People simply have different personalities. There are plenty of people that shouldn't try to be funny, either because their humor is juvenile, or offensive without nuance. There's nothing wrong with not being funny. Humor by itself doesn't actually add or negate anything from the narrative. Trying to be funny doesn't usually work out, and only career comedians have incentive to try. If you try to be funny, but your idea of funny is fart jokes, now you're actively harming your own narrative, when someone that's naturally funny wouldn't be trying to do anything at all, it would just be part of their author flair. Trying to be funny is usually associated with being annoying. If you take the funniest people you know in real life, odds are they're either the kind of person that treats every interaction like the set up to a punchline you never asked for (think like a fun uncle), or they're just someone that goes through life with wit under everything they say.
Eminem once said:
I'm like a head trip to listen to
'Cause I'm only givin' you things you joke about with your friends inside your livin' room
The only difference is I got the balls to say it in front of y'all
And I don't gotta be false or sugarcoat it at all
Which is a valid critique of his own humor. Bear with me through one more fart reference. If you're hanging out with your friends, the loudest fart might send all of you into a fit of laughter, but if that's your idea of humor, it ignores the bias of friendship, when anyone with a funny bone could tell you that it has a 99% chance of flopping in any setting that actually values humor. Humans naturally seek humor, but if we considered every human to be funny, then there'd be no such thing as a bad joke. Dad jokes are known to be painfully unfunny, and yet we revere them as ironically funny, with fathers finding less humor in their own jokes, and more humor in the pained reactions.
I implied that you can't just learn how to be funny, but it's technically untrue since there really are professions and professional studies dedicated to it. I can't stress enough though that we really only see the top 1% of what makes it off a producers table, and only 1% of that 1% ends up being actually funny, and still not funny to everyone. It's less that you can't parse data and structures to make something funny, and more that it's a major waste of time trying. Someone like a comedian is basically living 24/7 in a brain that views the world through a comedic lens. That's their natural state. Trying to be funny is like asking a comedian to not see things as funny.
Quite literally, most people aren't significantly funny. I'm ranting now, but let me wrap up. If you believe in the Theory of Multiple Intelligences, which is very easy to believe in through different lens, then the theory basically states that people are inclined towards different talents/intelligences. As a writer, you're already "beating" a lot of people because you have an affinity for literary intelligence. A good comedian would probably be good with words, good with people, and very self-aware which is already three different kinds of intelligent. You obviously aren't just dumb if you're not every single kind of intelligent, but it's a short life. You literally can't do it all. People are built differently with different skills.
Conclusion: I don't know you, so I don't know if you're funny, but let it rip. If you're dedicated to exploring a whole new genre, then the best thing you could do is learn what's not funny. Too many people think in the 2020's that they're comedy savants because they offend people. If the only aspect of your humor is being offensive or gross, it's likely not comedy. Humor relies on cleverness, and even slapstick like Looney Tunes, The Three Stooges, or Beavis & Butthead are doing a lot of subtle things to make it pay off. The question is, are the writers treating this like rocket science, or are they already just that friggin' funny?