If you accept the person and the situation for it really is, not try to control to the way you wanted it, things will be easier for you and the person you're friends with. Not everything can go well as planned and not everyone is always in a good mood, but it's okay because people have stuff going on at home that causing them to act towards you so it's not your fault. But if you don't take in things when the person says that she or he needs some space then it's important to respect their wishes and give them what they need. Trying to control the problem will not make things better, it'll only make things worse. You might lose your relationship with the person and probably will be devastated for a while. it's important to accept things as they are and how they come every day whether it's good or bad but don't let it get the best of you or take it to heart because then it'll lead to a misunderstanding of the person saying that he or she doesn't want to be around you anymore. Also, when the situation went from bad to worse and causing a lot of serious problems, these things need to be take time for the issues that involve with the situation to be resolved, don't try to take matters in your own hands.