You can define a function using the reserve word def
they are commonly methods than return a value
def my_function
return "something"
end
You can pass arguments that will be used within the method like this
def sum(a, b)
return a + b
end
This method return the sum of a plus b arguments