Step 1) Open Terminal under Applications > Utilities > Terminal, or by pressing CMD + Spacebar and typing in Terminal.
Step 2) Copy and paste this line of code into Terminal to enable the debug menu.
defaults write com.apple.Safari IncludeDebugMenu 1
That's it! You now have the debug menu enabled! If at any time you want to revert back to Safari without the debug mode on, simply use the same code and change the one at the very end to a zero.
Questions? Leave them in the comments below!