Start by interviewing all your living relatives for birth dates & places, marriages, deaths, etc.
Look into local archives, church records. Then go on-line at FamilySearch.org, Ancestry.com, MyHeritage.com, Cyndislist.com. Where you go will depend on the country of origin of your ancestors.
Keep a careful record of your sources. You might have to revisit them when you come across contradictory information.
There are many free programs to record your information: Legacy, RootsMagic, Ancestral Quest.
The far more common case is (distant) cousins marrying. Go back two hundred years, most working class people were born in one town, married in the same, and died there, so unsurprisingly you'll come across the same people in multiple branches.
Indeed, and there are also interesting modern cases where two gay men might get married, and adopt a child - in that case the child has no mother.
(Well obviously there is a mother in the biological sense, but it might be that the data isn't available. Instead in tracking a "family" tree you'd have two fathers.)
I am one of its users. I am not using all of its options but it's very useful for professional genealogical researchers. This means people who want to record every aspect of their ancestors life (photos, records, details, etc).