A function is the basis block of every language. It permits to group statement.
It makes the code more readable but also more reusable.
Their is a whole science on when and how you would split your code.
Our advice, don't do it while you have not got the feeling that it sucks to do always the same thing.
This language construct is also so important that we have created a dedicated section to function.
For more on function, see its dedicated function