Well... I obviously don't know you. But I doubt you're a useless guy.

I also know, though, how punishing getting through school can be. (I had my own struggles with it many years ago.) I take it you're currently in Australia & you're going to be returning to your home country to continue your studies? Perhaps being back in your home country will be helpful. I would guess that being in a foreign country studying must add a certain amount of stress even beyond what going to school creates to begin with.
You mentioned one reason you feel depressed is because you feel like everyone is graduating at an earlier age & you're wasting a lot of time. It's just my personal opinion, but I think we always put ourselves in danger when we compare ourselves to others. We don't really know what's going on in other peoples' lives. So it's easy to look at just one small aspect of their lives & imagine that we somehow don't measure up. At least from my perspective, I think it is better to just look at where we are in relation to where we want to be. And, if we don't seem to be progressing, then we can look at why that might be happening & what we can do about it.
From what you wrote, it sounds as though you are working full time as well as studying? If that is the case, perhaps you're just trying to pack too much into your days &, as a result, you're coming up short. Given that you apparently failed one unit & that this may create some problems for you academically, perhaps meeting with one of your professors or an academic advisor, either at the school you're at now, or at the one you'll be going to when you return home, would be a good idea. I know it's tempting, when things aren't going well, to withdraw & "hibernate" so to speak. But I think when you're encountering difficulties is the most important time to reach out for help. My best wishes to you...