How to learn to be alone

So I (M30) broke up with my recent ex almost a month ago and I was recently divorced before I met her. Probably not ideal to jump into another relationship I know but I learned.

I’m going to therapy and on meds to help process my marriage…wasn’t great and I sacrificed a lot to help take care of her and her family with little to no appreciation. It’s not what I was looking but acknowledgement at least.

Recent ex was also going through a divorce but hers was has yet to be finalized and I guess reality hit of our relationship and things just started to fall apart.

So now I’ve been finding myself in moments of silences but I’m not okay with it. I have to keep something playing music or tv going otherwise I go into deep thought of everything.

How did you learn to be okay being alone? Marriage was 5 years but with my ex wife since I was 17 Recent breakup was 8 months