You aren't hiding unless the DM says you can take the hide action, and they can if they want, decide you can only take that action right before it's going to actually come up.
So as an example, the PCs are travelling somewhere and decide to move at a slow pace and travel stealthily. The DM is...