A function is a piece of code that takes zero or more values (the function’s “arguments“) and returns a result.

You “call” a function to get its value. A function performs a specific set of related tasks within your program.

So, you could have a function that deals with everything to do with making toast within a program that makes your breakfast.

I’m told this is used interchangeably with the term method, but there are differences between the two as explained in this thread on Stack Overflow: the difference between a method and a function.