One thing any novel should do is vary it’s tone throughout. Even a sad book needs happy moments and vise versa.
One episode of Star Trek that did this well is The City on the Edge of Forever. At stake is the existence of the federation itself, if Kirk and Spock fail all the good that the Federation and Starfleet had done would be as nothing. Yet the episode still had very funny moments that are among the most quoted of the original series.
One way this was done was through time. Kirk and Spock had time to decompress, they were not rushing around the entire episode.
This changing of tone meant they could build more tension. It’s more startling if your taken from a moment of hilarity to one of tragedy then one of tragedy to slightly greater tragedy.