JSFiddle - React, Tailwind, and code Playground

HTML

<div id="countdown">24</div>

CSS

#countdown{
    font-size: 5em ;
}

JavaScript

var count=24 - 1;
    var speed = 1000;
    timer();

    function timer()
    {
      count--;

      //Do code for showing the number of seconds here
         document.getElementById("countdown").innerHTML=count; // watch for      spelling

      if (count <= 1)
      {
         return;
      }
      
      speed = speed / 1 * 5; // or whatever
      setTimeout(timer, speed);

    }