Start with clear naming: Use descriptive names that explain what the function does. calculateTotal() is better than doStuff(). Use camelCase for function names.
Keep functions focused: Each function should do one thing well. If you're using "and" to describe what your function does, it might be doing too much.
Understand parameters vs arguments: Parameters are the variables listed in the function definition. Arguments are the actual values you pass when calling the function.
Remember that functions need to be called: A common beginner mistake is defining a function but forgetting to actually call it. The function won't execute until you invoke it with parentheses.
Return vs console.log: return gives a value back to use elsewhere in your code. console.log() just displays something in the console. Return is usually what you want for reusable functions.
Start simple: Begin with basic functions that take simple inputs and return outputs. You can always add complexity later as you learn more concepts like callbacks, arrow functions, and scope.