Advice on creating a Function

Thank you!