how to be not emotionally dependent on anyone?

Hey everyone, hope you all are doing great

this is sad but its true that I dont have any genuine friends

so what happened is I have this "friend" whom I met during my work training with whom I talk daily text share stuff vent and he is the only person with whom I talk and share stuff apart from my parents ( I live with my parents) and I didn't have any problem with that until now, he also used to tell me how he was betrayed by his friend .. his other friends doesnt consider him as a friend etc etc how even he is loney af doesnt have anyone to hangout and all .. so l could relate to all of it so we started texting and talking and I became emotinally dependent on that person a lot, If any minor inconvenience happens I would call if there is anything good I would call and tell.. but whenever there is a little change in their behaviour or mood its affecting me a lot to the extend I will start crying and literally felt breathless at times ... If they don't text or call I would just sit and cry assuming they will leave me , I don't know how to deal with this or ask anyone, I have other goals in my life I am going through other sort of things in my life which I have to fix by focusing on my career which i am not doing seriously....

this person all of a sudden realized he has other friends whom he can talk and hang out with and i realized he isnt emotionally dependent on me at all coz he has other friends family etc.. I am not saying its wrong its my fault i became emotianally attatched... Now if he is with someone he doesn't text or call all its been days.. I dont know since I dont have anyone it feels like i am back to square one of not having anyone to share stuff again... I will become anxious amd cry and I will keep assuming something might have happened thats why they are not texting or calling, so i will only text or call just to know he is hanging out with someone .. Its not wrong from their end at all but its just affecting me I dont know what to do and I dont want to be like this, I want to be fine with not having anyone to share stuff...