So depression is not a matter of mood or motivation; it's a medical problem that calls for treatment.
If you're just sad and anxious because you don't get along well with folks at work, that's probably not a medical problem. Still, if it's bad and getting worse, you probably want to be sure, just in case. Talk to a healthcare provider to get some help deciding if it's a serious problem, or if it's just that you don't like your situation.
You might not be doing anything wrong at all. There's no reason to think you're going to get along well with every person or team that you meet.
They might not be doing anything wrong, either. Sometimes people just don't get along. For example, I can think of a couple of people that I have great respect for, but that I don't want to share a room with. Not because they're doing anything wrong, and not because I am; we just rub each other the wrong way.
Do your due diligence to make sure you don't have some serious health condition developing. Endure the situation because it might get better, until you're pretty sure that it won't. If you don't get past it, and it seems like it might be bad for you, look for another job.
You don't have to get along with everyone. You don't have to stay in a job that's not good for you.