How to write APEX Triggers and What are the best practices?

Apex triggers allows you to perform some actions when any record is created, updated, deleted or undeleted in Salesforce. What can we do using triggers? A trigger can perform following actions: Insert, Update, Delete records. Update fields from child to parent and vice-versa. Send Emails to record owner, external user, contact & lead etc. Call…