Help!

Hello.
I’ve had this problem for the past 2 days.
I just reformatted my computer because Garrys Mod wouldn’t let me play Online (Multiplayer).
What happens now is I can’t even start it up.
I click on launch, the loading screen for starting up Gmod pops up and it finishes loading, then it just…closes.
Help me please!

Install Direct X, because computers do not come with it by default. I have another solution if this does not work.