Anxiety and depression are not always easily spotted. There is no one face that tells you someone has anxiety or depression, and there is no one action. Often many people with it are very good at hiding it. Certain things that can cause depression are drastic life events, like losing a loved one or sometimes the end of a friendship or relationship. After things like this occur some people just need to step back and be on their own for a little. There is nothing wrong with being sad, there is nothing wrong with wanting to be alone. Everyone deals with everything differently.
There are many signs that could help you detect if a friend or family member is dealing with depression or anxiety. Some signs could be if they are usually an extroverted or outgoing person and they kind of avoid all human contact. Again, sometimes people just need time and space after something very tragic has happened to them. If you notice someone is mourning too long then maybe try to talk to them or even get help for them. Usually when someone is depressed they don't want to feel like a burden to anyone. Even if you tell them "You aren't a burden." They will still feel as if they are going to bring you down with their problems, it is just human nature. Best thing to do is to wait for them to open up, it isn't a good idea to force them to. Trying to force someone to talk out their problems will just make them more defensive and try to hide their emotions more.
If you think a friend is struggling depression, best ways to help them out is to treat them how you normally would. When someone is going through a tough time things are usually are changing around them 100 mph. So the best thing to do is to stay the same, most of the time they just need some balance when they feel that their world is tilting the wrong. As a friend it can be hard to deal with someone going through tough times because they might take their anger out on you. If a friend randomly is getting upset at you out of nowhere that is another red flag that something is going on. In this situation you can only try to not to get mad back and talk to them. Ask why they have been acting different. Getting angry at them will make them want to isolate themselves even more and they will believe that they are alone. In the heat of an argument you don't really think about the other person and what they are going through but sometimes all we need to do is think before we react. It could possibly save a life.
With these few tips and hints on how to detect depression, I hope you can help a friend or even a stranger. Just remember that sometimes we have to see things from their point of view before we react. If you are going through something, always remember you are not alone. Even if you don't feel comfortable talking to friends and family. There is always someone who can relate and will listen.