clearTimeout(timer)

timer object is returned by setTimeout. Example:

timer = setTimeout(() => el.innerText = "Update text after 5 seconds", 5000)