Use while when the number of iterations is unknown and the loop must continue until a condition changes. It’s ideal for user input, retries, waiting for events, streams, queues, async tasks, or infinite loops. Avoid it when iteration count is fixed use for instead.