How to safely override and modify default bbPress templates?

There are many ways to modify the way the bbPress forums look like, styling changes, filters and actions and overriding the templates bbPress uses to render all the forums elements.

How to add custom code from the bbHelp Club Answers

Many of the answers on this website include the custom code you need to use (and maybe modify) to achieve something related to bbPress. What is the best way to add this code?