First, create unique and funny ghost characters. For example, a clumsy ghost who keeps tripping over its own ectoplasm. Then, add humorous situations like the ghost trying to haunt but being scared of the family dog. Also, use witty dialogue. Let the characters crack jokes about the afterlife or ghostly traditions.
Effective comedy ghost stories often rely on subverting expectations. Instead of the typical scary ghost, make it a friendly or bumbling ghost. You can also play with the setting. For instance, if the story is set in a cemetery, have the ghosts be more interested in gardening than scaring people. Incorporate cultural references about ghosts from different cultures and give them a comical twist. For example, a Japanese yokai - like ghost that is more interested in eating sushi than causing harm. Dialogue is key. Have the characters exchange sarcastic remarks about the presence of ghosts, like 'Oh great, another invisible roommate.' This kind of banter can make the story really engaging and funny.