How to pre-configure Raspberry PI for remote SSH and Wifi

Many Raspberry PI projects are used headless (with no display device attached or if a display device exists, it’s not connected to the default HDMI or analog outputs).
In these instances it’s time consuming to connect the PI to a monitor and keyboard just to configure remote SSH access and wireless connection details (and in rare occasions it may even not be possible).

Luckily, the good folk developing Raspbian implemented shortcuts and workarounds that allow things to be pre-configured even before booting the PI.