Do you think some people are temporary in your life to teach you a lesson?

For example a relationship, friendship, fling, family member etc anyone who has left your life or you felt the need to leave. I've always felt like there was a reason behind it growing up and they left to bring better relationships to come in my life. It's kind of weird and crazy how i think about it now and reflect on it like wow i wonder how life would've been if so and so did this or maybe i said something differently. Thoughts?

Updates
1 y
I guess i was the girl who always cared a lot about others and did the best i could to be kind, loyal, considerate, dedicated but If anything i learned my worth and im the only one who needs to recognize it. Im grateful for my few fantastic friends today since grade school and few close family here for me. I just wish those people a good life either way and keep them in my heart.
Do you think some people are temporary in your life to teach you a lesson?
Post Opinion