Loan modifications may be sought at the pre-foreclosure stage, during the foreclosure process and in bankruptcy.  The loan modification process is best when started early.