So far all your programs have been large blocks of code that generally run from start to finish (with the occasional loop). Although this is fine for small programs, as they become more complex it becomes necessary to be able to organise them into smaller distinct blocked that focus on specific tasks within your program. This is achieved using subroutines.
A subroutine is a named block of code that you can call from anywhere in your program. When you call a subroutine, the program makes a note of where it is at the moment, and then jumps to the subroutine block. When the block has finished executing, it uses the notes it has made to jump back to the next statement after you called the subroutine.
What this means for you is that you can concentrate on making a small part of your program work exactly as you want and then package it up and move it out of the way. Any time you need that aspect of your program, you just call the subroutine knowing that it works exactly as you want.