Explained so simply anyone can understand
A function is like a machine.
Example:
That machine is a function.
An object is just a thing.
A function can take a thing and do something to it.
The function takes an object (the number 2) and gives back a new object (3).
Some functions are more powerful.
Instead of taking a thing, they take another function.
“Use this function twice” does not care about numbers or apples. It only cares about another function.
This is called a function that takes a function.
You should not give the wrong thing to a function.
This idea was explained by Frege a long time ago. Today, programming languages use the same idea to avoid mistakes.