Cannot start service SPUserCodeV4 on computer

If the service Microsoft SharePoint Foundation Sandboxed Code Service is stopped and when you are trying to deploy a webpart using Visual Studio 2010 we may face the error message saying that Cannot start service SPUserCodeV4 on computer <computer name>

Error - Cannot start service SPUserCodeV4 on Computer

Error – Cannot start service SPUserCodeV4 on Computer

To resolve this
Go to Central Administration > System Settings
On System Settings page, under Servers section click on Manage services on server

Start Service - Microsoft SharePoint Foundation Sandboxed Code Service

Start Service – Microsoft SharePoint Foundation Sandboxed Code Service

Next you will be able to notice the services in stopped/started status, look for the service Microsoft SharePoint Foundation Sandboxed Code Service and click Start, once you start then you will be able to deploy webpart or custom solutions created in Visual studio 2010