How to install and flash a window properly

This is a how to as to how to properly install and flash a window.  I have yet to remodel a home and see a window that we are removing that has been installed correctly.