But the principal thing to be sought for in this temptation is the remedy thereof. Whereunto there are five things required, which are to be practiced as occasion shall be offered.
First, choice must be made of the most fit and present remedy, and that must be used in the first place. Now the most fit and present remedy is to bring the troubled party to the personal exercise of faith and repentance by and in himself. For this end, [first], he must examine his conscience most straightly and narrowly for all the sins of his heart and life. Second, he must humbly confess against himself all his known sins, and withal acknowledge the due condemnation that he thereby has deserved. Third, he must cry to heaven for mercy, entreating the Lord most instantly for pardon and for the restraint of His wrath due unto him for his sin. David, being in this distress, performed all these duties, as we may read in Psalm 6. And he says further of himself, that "whilst he concealed his sins, the hand of God was heavy upon him; but upon his earnest confession (and deprecation), he received mercy" (Ps. 32:3,5). And if we read the book of Job, we shall find that the principle scope thereof is this: namely, to show unto us that Job was thoroughly exercised with this temptation, and that in the end, having been rebuked both by his friends and by God Himself, his recovery was made by humbling himself, when he says, "Behold, I am vile." Again, "Now I abhor myself, and repent in dust and ashes" (Job 42:6).
Some may here demand, "If it falls out that the person himself cannot perform any good duty by himself by reason of his distraction in soul and body, what then must be done?" Answer. If the party can but sigh and sob unto God for mercy and comfort, it is no doubt a work of God's Spirit, and a practice both of faith and repentance. "We know not," says Saint Paul, "what to pray as we ought (namely, in our distresses), but the Spirit itself maketh request for us, with sighs that cannot be expressed" (Rom. 8:26). And therein lies our comfort for us, with Moses at the Red Sea, being in great distress, and not knowing what to say or do, sighed and groaned inwardly in his soul unto the Lord for help and protection (Ex. 14:15). And his very desire was instead of a loud cry in the ears of the Lord." William Perkins 'The Works of William Perkins' Volume 8 pg. 172 The First Book of the Cases of Conscience