I decided to quit because I felt bad
Does this have to do with the work you are doing?
Yes, I hate what I'm doing here
If you're no longer happy at a job it makes sense that you would quit. If something like that is impacting your mental state then it's well within your right to quit.
I just didn't have the mental stability to do my job.
I'm sorry to hear that. It is ok to quit something if it is impacting your mental health. You should put your health first before you try and do other things.