This doesn't work because you can't call your function at the top level of the class. I assume you have an extends
line at the top that you just didn't copy and paste. You could call it when the program is run like this:
func _ready():
my_function(12, 21)
But note that even then, you're discarding the return value, so you'd probably want something more like:
func _ready():
var c = my_function(12, 21)
print(c)
I don't know your level of programming experience, so If this doesn't make sense to you, I strongly suggest that you start with a beginner-level coding tutorial - Python would be my recommendation.
If you do know how to code, but you're just confused about Godot & GDScript, Step by step section of the official docs. There is a lot of important foundational material there.