Fixing The ‘Security Token Service Could Not Be Activated’ And Starting It Using IIS Manager

When I use share point, and I try to run the token service, it says ‘security token service could not be activated,’ what is the reason and how can I avoid this problem?
