Countdown

I need a countdown timer. I am using a Nextion lcd and arduino uno. I want the count down to display on the touchscreen lcd and I also want the time to be set from there. The lcd part is simple. I am stuck as to what code I use for creating the timer and setting it. This is all completely new to me.

Get countdown time setting from user interface.
Get the current time from the Arduino.
Calculate the target time.

while current time is less than target time
update display counter
else
update display "finished"
exit

Something like this perhaps

countdownValue = 999;
if (millis() - prevMillis) >= 1000) {
  prevMillis += 1000;
  countdownValue --;
  display(countdownValue);
}

...R