I've had a similar thing happen to me in the past, I recommend talking about it to your family and seeing what they can do to help you.
Friends help too but in my experience most of them didn't understand why I was so broken because of it, my pet was one of the most comforting and joyous things for me to be around and I'm betting Marley was the same case for you.
I won't be able to tell you how to fix the feelings from his death because grief takes time. Quite a bit of time, and as long as you have constant support from family, friends, teachers even you'll be able to get through this.