The framework to guard your senses is outlined in the Cha Chakka SuttaCha Chakka Sutta though there are more comprehensive dispositions also in other Suttas which covers other aspects also e.g. Satipatthana Sutta Dhammanupassana section.
Nimitta and AnuvyañjanaNimitta and Anuvyañjana by Piya Tan