Learning how to customize templates via code and best practices

Learning how to customize templates via code and best practices

Hi! 

Our developers team want to learn how to edit our template files safely. The last time we messed with these files our site went down for a day and we had to reconfigure it from scratch.

What are the best practices to do this? How can we get a template and mess with their files to try some additional features without risking our production store?

Thanks in advance!