Selena Gomez and Justin Bieber

Selena Gomez has turned her pain into a purpose, and she says it was the best thing to happen to her.

The singer talked about her break up with her boyfriend in her new doc.

Justin and Selena -- Back In The Day Getty

Selena admitted it was difficult to end her relationship in public. I was haunted by a previous relationship that no one wanted to part with, but I just moved past it. I was no longer scared.

She kept going on. It was the best thing that ever happened to me, because I had to go through the worst possible heartbreak and then just forgetting everything at the drop of a hand, it was really confusing.

They dated on and off for five years. After their split, there was a lot of drama, especially when he got with a girl. Selena fans were loud.

Call Her Daddy

On the "Call Her Daddy" show, she said that was BS.

At the Academy Museum Gala in L.A. the following month, it was apparent that the drama between the two was behind them.

Selena told Rolling Stone that her mental health struggles would have set her back in the past.

Selena's hit song "Lose You To Love Me" is one of the ways she's turned her life around.