In previous programming an operation that didn't return a value was known as a sub-procedure. This may still be the case in some languages however many modern OOP it makes more sense to simply return {void} ( or not return any value at all ). The function will still return a value of null. But that value isn't necessary to be acknowledged.

A function is useful to perform a repeated operation. It's a machine to do a task. When writing code, look at operations that are repeated. "what can be reduced into a function"?

NOTE: In this pseudo-code example data types are acknowledged only. Some higher languages don't require data-types to be declared, but it is always a good idea to acknowledge them in comments. Knowing the expected data-type helps when building and debugging and also helps to avoid type-juggling. Finally, in lower languages it helps to avoid data-type clashing.