How to Safely Store Passwords, for developpers

How can you safely implement a password storage and hashing function?