So that function expects another function, so you can do something like this:
// Using a def
def myFun(i: Int): Int = i + 1
sum(myFun, 2, 3)
// Using a val
val myFun: Int => Int = i => i + 1
sum(myFun, 2, 3)
// Using a lambda
sum((i: Int) => i + 1, 2, 3)
// Using the underscore syntax
sum(_ + 1, 2, 3)