Don't worry, you're like most developers when they learn about callbacks. It's an idea that takes a little time to get used to.
There are some good examples of why we use callbacks in some situations.
For example, if we create a button, we'd like to know then it's clicked. We do this by assigning a callback function, say buttonClicked(). In that function you can do something cool like popping up a message "Hey thanks for clicking!"
Likewise, we use callbacks for timers. If we want a timer to run, say every 5 seconds, we assign a callback like timerFired()
function buttonClicked() {
alert("Hey thanks for clicking!")
}
<html>
<body>
<h3>Button Example</h3>
<button type="button" onclick="buttonClicked()">Click Me!</button>
</body>
</html>
function timerFired() {
console.log("Timer fired");
}
setInterval(timerFired, 5000);