My best recommendation is that you wait until after your mortgage closes on the home you want to purchase before you buy a new car. If you apply for a car loan your credit score may go down temporarily due to a hard inquiry on your credit report, which can negatively impact your mortgage rate. Additionally, the monthly payments on the car loan are included in your debt-to-income ratio which may reduce the mortgage amount you qualify for. You can use our Mortgage Qualification Calculator to determine what size mortgage you qualify for both with and without the car loan payment.
If you absolutely want to purchase the car before you buy your new home, paying in cash is likely the best approach as long as you have sufficient funds remaining after the car purchase to pay for your down payment, mortgage closing costs and any repairs or upgrades you may want to make to your new home. Paying cash for the car may deplete your cash reserves but your credit score and debt-to-income ratio remain unchanged which is beneficial when you apply for a mortgage.