Great question, I wish more considered this early in the process. Here are some basics. Pay everyone on time or early. Keep your balances low and pay down any high balances you have to 1/3 or less of the credit limit. Dispute any errors you have on your credit report in writing with each agency that reports them. Do not close any accounts or pay any old collections unless/until instructed to by your loan officer.
Some lenders assist with credit repair and may be able to speed the process up for you, so start hunting for a great local lender early ask if they help. You may be in position to buy sooner than you think.