A function is a named block of code you can run anytime. Give it a name, write the steps inside, then call that name when needed. Instead of writing the same lines in ten places, write once and call ten times.
Think of it like a recipe. You don't rewrite "how to make sauce" every time. You label it and reference it. Functions work the same way. Every function does something specific: calculates a value, prints output, or modifies data.
You've used functions like cout. Now you'll write your own.