is it correct to ask
What are you going to do if you lose your pants on the train?
Or maybe better to ask
What are you going to do when you lose your pants on the train?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.Sign up to join this community
I agree with @JasonBassford - both sentences are grammatical. They have different meanings, though - the first (with if) leaves open the possibility that the listener might not lose their pants. The second (with when) assumes that the listener will definitely lose their pants and it’s just unclear at what time that will happen.