DIY Cable Routing Guide
Video description
Most bikes will have a dedicated cabe routing guide, however if you don't have one of those, a quick little hack is to use a zip tie and endcap.

Related how to's