I know what you mean. I get down also when my gf is away. She lives 2.5 hrs away. But I don't get so down I start arguments or get irritable. But everyone is different.
Well, you didn't put your age so it's hard to guess at what is going on. My answer depends a lot on the maturity of both of you. That said, you need to talk to him about how you are sorry your emotions made you irritable, and how you are trying to improve yourself. Letting your emotions control you almost always ends up badly. You need to admit to him you were wrong, that you still want to be with him, and that you will work on yourself to be better.
So, I don't know if you pushed him away, which is why you need to talk to him about this.
I have a long time interest in psychology, specializing in relationship dynamics for 30 years.
(Please note, we give the best advice we can based on the information given in a post. For better advice, please include the age of all romantic partners.)