Disable click event on Next button on checkout form's first step if all cart products are removed
What module are you using for the cart?

you can also use preventDefault() function to stop the page from loading to the next page.