Note that downgrading your iPhone firmware is only possible if you have saved your SHSH files. For those who prepared by taking this step before upgrading, see the following instructions to downgrade.
First download your SHSH files to your computer with TinyUmbrella.
1. Install TinyUmbrella.
2. Plug in your iPhone and run TinyUmbrella.
3. In TinyUmbrella select Advanced Options and choose 4.0.1 firmware.