Should you have cash available to pay off debt, you should do so. If you can do this before you even apply for the loan, so much the better. If the adverse items on the report occurred because of illness, marital problems, job layoff or other temporary circumstances and were confined to a particular period of time, you should have provided the lender with a written explanation at the time the loan application was taken or at some other point in the process. If you didn't do it then, do it now. Assuming there has been sufficient time since the problems occurred for you to regain financial stability and demonstrate prompt payment of your obligations, there is a good chance the lender will reconsider the loan request.
Many lenders look for one year's clean payment record to offset past credit problems.
If the credit report is accurate and you have a questionable credit history, you need to start repaying outstanding balances on time in order to re-establish an acceptable record. It may take time, but there is no alternative when this problem stands between you and owning a home. Sometimes, particularly if your credit record is very good, if you can show that you are already carrying that much housing expense through rent or mortgage payments, you may be able to convince the lender to reconsider. This is an example of why full and accurate disclosure on the loan application works in your favor, even though it may not be obvious at the time. If your personal circumstances change after the submission of the loan application let the lender know.