You should retain counsel immediately to prepare a response to the foreclosure complaint. Your question suggests that you were not served with process (i.e., you did not receive a summons and complaint from a Sheriff's deputy or private process server) and such failure may be a defense to the foreclosure action. You may have other defenses to the action depending upon the alleged bases for the foreclosure action, and a lawyer will help get these defenses before the court.
Disclaimer: Please note that this answer does not constitute legal advice and should not be relied on because each state has different laws, each situation is fact specific, and it is impossible to evaluate any legal problem without a comprehensive review of all the facts and documents at issue. This answer does not create an attorney-client relationship.
If your objective is to defend the lawsuit, and if you HURRY and get a knowledgable foreclosure defense attorney to represent you IMMEDIATELY,there are probably legitimate and sufficient defenses that could be raised. It may not be too late to defend yourself. However, do not try this yourself or it will very likely not work. If you have been defaulted, you cannot even raise defenses unless the default is vacated.
An Action of Foreclosure is a lawsuit, and subject to many defenses which, if raised properly, can change everything. It may not be too late for you to raise them. However, there is no one who can properly advise without a detailed analysis of your case and all the issues relating to it by an attorney who is highly experienced in defending foreclosure cases. Every case is different, there is no one size fits all response or defense that would be appropriate, it would depend on the exact details and legal issues in your case. Only a really qualified foreclosure defense attorney will know how to even figure out what those are.
Serious foreclosure litigation is extremely difficult and complicated. This is not something that even most attorneys know how to do. We have clients who are themselves attorneys, yet have come to us for help because they understand this, and realize that in order to have a chance against the "big guys" they need really qualified people to help them.