Hi and welcome. The steps are:

1) Create your separate function file and place your function in it. For example, lets say you call it "myfunctions.kix".

2) In your "main" script, place this at the top:

CALL "myfunctions.kix"

3) Then just call your function from your main script.