How would I create a decrease timer function used in this video?

Not sure if that would work for my timer, Im new to coding and the video I watched did it a different way.