It's nice to install some useful extensions or plugins to your Visual Studio before start programming. One of the best of these is the "Productivity Power Tools" extension. You can directly download and add it to Visual studio from the "Tools" menu "Extensions and Updates..." or download it from https://marketplace.visualstudio.com/ and install.
If you installed this extension, now let's have a look at one of a feature of it.
In order to remove all unused namespaces from a .cs file on saving you just need to enable the "Remove and Sort on save" feature of this extension from the "Tools" menu, "Options".
Please be note, there are several extensions with this name, It's nice to get the one which created by Microsoft or MirosoftLab.
Here are some extension to write better code