It c a n take time. I never had much of an ego to begin with. I’m pretty happy with me in many aspects. I’ve written countless songs with all sorts of people. From friends to strangers.
Tips : don’t be bossy, even if you are lead. Collaboration has no place for leaders, only people. Occasionally, even in the best circumstances, we (people) get on each others nerves pretty badly. Learn to recognize when to take a break.