Yo OP, I know shit is tough right now, but it sounds like you're a pretty young dude. Fuck ups are not only allowed, but incredibly encouraged at your age.
The most important lesson to learn is that you'll never stop learning lessons. It's impossible to see right now, I'm sure, but the fact of the matter is that this will be a learning experience. Next time maybe you'll be able to risk the bold action of letting the girl know you're into her before you'd normally feel ready, or maybe open up to your friends more when there is a girl you like.
Learning is not simply absorbing the knowledge, this is key. You have gained the knowledge that letting your feelings percolate for to long carries risks. Taking that knowledge, and using it to change the situation next time around is when knowledge acquisition becomes learning.