Having something both funny and scary at the same isn't really possible.
(at least for the majority of authors and without a lot of preparation)
Horror works through building up tension and keeping it up even when nothing happens while comedy works through the depletion of tension. E.g. the usual punchlines build upon "tension" you build up through the sentences before.
At the same time, comedy and horror go against each other.
But they also complement each other when they are used alternately.
One of the big problems of horror are the rising stakes. If the tension is kept too long at the same level, then the impact will be less effective. So it's better to break the tension from time to time. One example would be the classic "cat jumpscare". It breaks the tension (so it can be build up again) but the catharsis together with "a cat" also makes a lot of people laugh at "how stupid that was".
The same example for comedy would be the usual "giant shadow at the wall" that builds a lot of tension through danger, because it gets smaller and smaller and in the end it's a really small person standing in front of a lamp. Because you build up tension through danger, the drop of the punchline is bigger and the "small person" is funnier compared to "a small person just stands there".
A more serious example would be "saving private ryan". Not a horror movie, but it also work on tension. Before the last big battle, you actually have the characters tell funny stories and release all the build up tension. This little bit of "comedic interlude" makes the last battle more impactful, because the tension goes from "0 to 100" instead of "60 to 100".
So while it is near impossible to do comedy and horror at the "same time", you can use one to highlight the other and the other way around...