A function is a piece of code that can be executed with parameters to avoid duplicating some functionality in your program.
Defining a function
A function always has a return-type - the type of the data that will be returned by the function -, a name and a list of zero or more arguments - each with a type and a name. The function-body describes the behaviour of the function.
Among the usual datatypes functions can have the return-type Void, indicating that the function will not return a value. Returning a value none-the-less will not compile. The same goes for not returning a value (or a value of wrong type) if a return-type is set.
Calling a function
To execute a function with given arguments, you simply call them like this:
declare Result = Sum(23, 19);
Expressions passed as arguments to a function are evaluated before calling the function.
To call a function it has to be defined prior to your call in the code. That means you can't call a function not yet defined and thus can't circularly call functions (e.g. fn1 calls fn2, which calls fn1). Functions may however call themselves.
Overriding a function
The combination of name and argument types makes the function's signature. No two functions with the same signature may be present in your program. However there can be multiple functions with the same name but varying in number and or type of their arguments. The compiler will choose the fitting function from the given arguments. This is called polymorphism.