I have macOS High Sierra running on my Mac, and it has worked fine until now. But today I experienced something very weird. I was trying to restart Apache (a web development server), and then my apps started reacting very weird. For example, I had Activity Monitor open, and then suddenly it crashed and when I tried to open it again, it either says "Activity Monitor is not open anymore." or just doesn't respond. And when I try to use Command Tab to switch to another app, it just gives me the sound that tells me that you cannot do that, and the same with Command Q and Command W. Not many of my apps are willing to open when I try to open them. After a while my keyboard even doesn't react when I type!
If I restart my computer, it is working fine in the start but when I try to restart Apache, it does all that crab again.
UPDATE: If I have an app that is not responding, lets say the Terminal, and I go to the menu bar and click Terminal > Quit Terminal, then suddenly the menu bar disappears.
What can I do to fix my computer?