User defined functions allow users to define blocks of code that can be called repeatedly from the main program to perform tasks. Defining functions requires a declaration specifying inputs and outputs, a definition implementing the function body, and calls from the main program passing actual parameters. Functions can have various configurations depending on whether they have arguments or return values.