How to leave a relationship?

I’ve been with my boyfriend for 5 years now , we have a 3 year old daughter together , he treats us very well but i am just simply not happy with him … he shows me no affection what so ever , never compliments me , we dont enjoy the same things etc… i talked about this to him before and nothing changed. Its been over 2 years I’ve been wanting to leave but cant build up the courage to do so because i feel so bad for my daughter. I dont want to end on bad terms but i know this will upset him and his family very badly.