This quote means that even during the most difficult or heartbreaking circumstances, there can be something that is very amusing or humorous. For example, a person could be grieving the death of a loved one, but still manage to make a joke out of the situation. Even in times of tragedy, something humor can appear in order to help people cope with their emotions.