Qutub e ‘alam Shaikh Rasheed Ahmad Gangohi (Allah have mercy on him) said,
The reasons for loss of (spiritually) achieved benefit include, lack of vigilance in maintaining it, entrapment in sinful activities or being careless in (permissibility of) food consumed.
Therefore, search for cause (and rectify it).
If it is the third reason then be careful (about the permissibility of food).
If it is the second issue then repentance and abandonment of the transgression is required.
If it is the first reason then intimate supplications, expression of weakness and humility in the court of Supreme Benefactor and chastisement of one’s self (nafs) heedlessness (gaflah).
In short the treatment is excessive repentance and (acknowledgment of) remorse.
Makateeb e Rasheediyah, page 39 quoted via Ifadat e wasiyah 348-9