In James chapter 4, the author is rebuking the letter’s recipients for their current behaviour. As the text progresses, he gradually strengthens his language about this until he’s telling them to mourn and weep, to change their laughter and joy for mourning and gloom.
…but he gives more grace. Therefore it says, “God opposes the proud, but gives grace to the humble.” Submit yourselves therefore to God. Resist the devil, and he will flee from you. Draw near to God, and he will draw near to you. Cleanse your hands, you sinners, and purify your hearts, you double-minded. Be wretched and mourn and weep. Let your laughter be turned to mourning and your joy to gloom. Humble yourselves before the Lord, and he will exalt you.
All of this seems more extreme than attitudes to repentance I’m aware of elsewhere in the New Testament – is the author’s instruction intended to be taken literally by its audience, or are these phrases meant to be interpreted figuratively?