How did we find out about genes?

How did we find out about genes?