I don t know how to program the timer.
If you want to watch TV for half an hour, do you have to program your watch? Of course not. You simply note what time it is when you turn the TV on. Periodically, you look at your watch, and determine how long you have been watching TV. If it has been long enough, you hit the off button.
So, you do the same thing with the Arduino. millis() is its watch. Variables are where you record things. "Periodically" means "on every pass through loop()".