Getting married is (or should be) a crash-course lesson in putting other people before yourself. I didn't think I was a selfish guy before I got married, but I soon learned hundreds of different ways I put myself first.
Having a kid is similar. It's a like a little hand-held mirror that lets you see places you didn't realize you were still selfish.
Now that I have a lovely wife and 5 little hand-held mirrors I think I'm pretty much cured of being selfish.
And then I decided to get a dog...