Rewrite code for reusable blocks of countdown timer

I want to convert an existing piece of code and package it into a function (variable 1, variable 2) so that I can call it back and use it many times.
I have a piece of code (collected on the internet) about a timer.
Link here: countdown 02 - JSFiddle - Code Playground
I want to convert an existing piece of code and package it into a function (variable 1, variable 2) so that I can call it back and use it many times.
Please help convert javascript and html into a function.

Code in jsfiddle

Hello, I would be happy to help, is this part of a code challenge on JSFiddle, Im just curious.

@robheyays thank you. this code from link https://www.youtube.com/watch?v=D_ygdIo7T0o
This is not a coding challenge but I am doing research for my web app.
Is it possible, when rewrite this code to function with 2 input : begin_time and end_time for countdown. If yes, can you edit my above jsfiddle. Thank you so much