Using humor in your writing is an invaluable resource for setting the mood, breaking the mood, or as brilliant counterpoint to otherwise dreadfully serious moments. Here are some (more) ways to use it in your writing.
https://www.helpingwritersbecomeauthors.com/writing-humor-2/