You could use delay(5000) but you cannot do much else during the 5 second delay time.
Alternatively, you could use millis(). In the long run, it is probably better to learn to use millis() (because it does not prevent you from doing other things) and avoid delay(...). See Using millis() for timing. A beginner's guide.