Remedy for immorality or wickedness (fujoor)
Question

What is the remedy for immorality or wickedness (fujoor) in the way one speaks, or the remedy for immorality and wickedness in general terms?
Praise be to Allah.Firstly:
Fujoor (immorality, wickedness) refers to going around committing sins and going to extremes therein, committing every abhorrent deed without any inclination towards repentance.
The scholars of the Arabic language said that the root meaning of the word fujoor is drifting away from the right path.
Sharh an-Nawawi ‘ala Muslim (2/48).
Al-Haafiz (may Allah have mercy on him) said:
Fujoor means committing a great deal of sins; it is likened to an outburst (infijaar) of water. The word may also refer to lying.
End quote from Fath al-Baari (1/165).
Az-Zubaydi (may Allah have mercy on him) said:
The root meaning of fajr is splitting, then the word was used to refer to going around committing a great deal of sin, haraam actions, zina (unlawful sex) and all abhorrent matters.
End quote from Taaj al-‘Aroos (13/299).
Ar-Raaghib al-Asbahaani (may Allah have mercy on him) said: The root meaning of fajr is splitting or rending, so fujoor is rending the curtain of religious commitment. This word is used to refer to an inclination towards mischief, and going around committing sins; it includes all kinds of evil.
End quote from Fath al-Baari (10/508).
Secondly:
Immorality (fujoor) in terms of speech includes lying and foul speech, and going to extremes in that. Al-Bukhaari (6094) and Muslim (2607) narrated that Ibn Mas‘ood (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said:
“I enjoin you to be truthful, for truthfulness leads to righteousness and righteousness leads to Paradise. A man may continue to tell the truth and endeavour to be truthful until he is recorded with Allah as a speaker of truth.
And beware of lying, for lying leads to wickedness and wickedness leads to Hell. A man may continue to tell lies and endeavour to tell lies, until he is recorded with Allah as a liar.”
An-Nawawi (may Allah have mercy on him) said:
The scholars said: What this means is that truthfulness leads to righteous deeds that are free of anything blameworthy, and righteousness is a word that includes everything that is good.
It was also said that the word al-birr [translated above as righteousness] refers to Paradise. It may refer to both righteous deeds and Paradise.
As for lying, it leads to wickedness, which is drifting away from the straight path or, it was said, going around committing sins. End quote.
Thirdly:
The remedy for immorality or wickedness in speech is striving to speak the truth and say the word of truth, frequently remembering Allah and reciting His Book, along with sincere repentance.
If a person occupies his tongue with truthfulness and remembrance of Allah, that will distract him from lying and foul speech.
The remedy for immorality and wickedness in general terms is as follows:

Starting first of all with sincere repentance, then adhering to obedience to Allah, focusing on remembering Him and reciting His Book, keeping company with good and righteous people and forsaking the company of evil and corrupt people.
Examining the attitudes and behaviour of the righteous, and following their example, and examining the attitude and behaviour of corrupt people and evildoers, and keeping away from their path, learning a lesson from their situation and how they ended up. For you hardly ever see someone who speaks evil or commits sin in terms of carnal desires or otherwise, but that is a path that leads him to disgrace and punishment.
Finding out about the characteristics of the pious, such as their good attitude, truthfulness of speech, restraint of carnal desires, control of their glance, kindness towards people, and so on, and striving to follow their example in our own lives.
Keeping away from that which may provoke unlawful desires and call us to haram deeds, such as letting the gaze wander freely, watching movies and plays, and keeping company with immoral and corrupt people who have no good aims in life.

Whatever the case:
Whoever focuses on attaining good characteristics, the attributes of people of faith, and keeping company with them, and strives to keep away from transgression, haraam desires and abhorrent words and deeds, and to keep away from people who indulge in such things, will be in good shape and his condition will be rectified.
Whoever finds himself committing such sins, let him hasten to repent sincerely and adhere to the path of Allah, and let him not delay repentance or procrastinate, or persist in sin and feel content with it. That will keep him away from immorality and wickedness.
And Allah knows best.