Custom Button that sends an email

Custom Button that sends an email

I'd like to create a custom button on the potential details that sends an email to the contact on record.  Where can I find information on how to write custom functions like this?