Half of toenail coming off completely? Help?

So, I was looking at my toe because the color was kind of weird a while ago and I kind of went to peel the top part of it off (it's a bad habit). And half of it is coming off completely.
The white part is what is coming off. I don't know what I'm supposed to do, was it an infection and should I leave it be? Or should I remove the white part and let it grow? Help?