I know you're not going to enjoy hearing this but the negative things that happen in your life serve a great purpose in your life! In fact, every single thing that happens in your life serves a great purpose in your life. Nothing is a coincidence.
There is a saying that goes: "Retrospect is 20/20 vision" meaning it's easy to know the right thing to do after something has happened, but it's hard to predict the future. Unfortunately things only make sense in hindsight only after the reason blatantly slaps you straight across the face or the bigger picture behind an event having to happen (both negative or positive) is revealed only after deep meditation and introspection.
Some people are here for a season or a lifetime. The good news is that both sides will result in a lesson or multiple lessons being learnt. Discernment is crucial in knowing in which category a person falls into because it is easy to get trapped into the delusion that a person is meant to be in your life for a lifetime because you love them but yet they were only meant to be in your life for a temporary time. Holding on only makes you hurt more. Letting go is difficult, but necessary.
Nothing is a coincidence. What you're going through right now is only leading you to somewhere even greater. The people you meet serve a purpose in your life. The lessons that you're given are actually there to teach you to grow. Some things only make sense when you look back at it. So just trust the process and continue to keep moving forward.