These three words have similar meanings. James uses them together to emphasize that the people should be truly sorry for not obeying God. (See: [[rc://en/ta/man/jit/figs-doublet]] and [[rc://en/ta/man/jit/figs-exclamations]])
This is saying the same thing in different ways for emphasis. The abstract nouns "laughter," "mourning," "joy," and "gloom" can be translated as verbs or adjectives. Alternate translation: "Stop laughing and mourn. Stop being joyful and be gloomy" (See: [[rc://en/ta/man/jit/figs-parallelism]] and [[rc://en/ta/man/jit/figs-abstractnouns]])