I can't install mods on Minecraft?

Whenever I try to install mods on Minecraft, open the launcher, and click play. The launcher closes and just reopens. I have no idea why it does this, also recently I got ATLauncher to play some modpacks and it does the same thing there.

Try deleting your.minecraft directory. Be sure to back up your worlds, resource packs, mods, and any other stuff that you want to save. But DON'T save your version folders. Make sure those get deleted along with everything else in the directory. Hope this helps.

Unfortunately it didn't work