How does out of pocket max work?

We already have payed 2000 and our out of pocket max is 6000 so if I go to the hospital and have a very high bill will I only have to pay 4000? And they will cover the rest 100%? Asking because I’m having a unplanned high risk pregnancy ☹️