A soda machine is an example of a function.
For each button pushed on the soda machine, or input, a can of soda is released, the output.
Each time the same button is pushed, the same type of can is released. For each button, there is only one type of can that is released. This makes this relationship a function. For the soda machine pictured, there are two buttons that will release a soda can. This is still a function.
A relationship exist between the button pushed and the type of soda received. In math, any relationship between two variables is a relation.
Because there is only one specific output (soda) for each input (button pushed), the soda machine relation is also a function.
The soda can, in this relationship, can be described as a function of the button pushed.