The book clean code from 'uncle bob' gives you a pretty good overview of how functions should look like, with hands-on examples.
Some important points:
- small functions, classes
- good, meaningfull, names, the size doesn't matter but should be exactly as long as needed
- vertical spacing between functions/variables should be low (declare stuff as close as possible to where it is first used)
- functions and classes should do one thing and one thing only
The book has many more little rules, I really recommend it. Also get Code Complete 2.