Wild dogs, for example, live in packs because their genes tell them to organize that way socially. No one has to teach them to do that. However, the pack is also where each dog learns proper dog behavior, practices the skills to survive, and ultimately finds a mate. Both, because they are difficult to separate. Humans are also social creatures.
Newborn babies respond favorably with lower heart and respiration rates to having people nearby.
Genes and environment work together and are not easy to separate. In contrast with the above case, the arrow can also go the other way, with the environment influencing which genes are expressed in a creature, and to what degree. Every organism has a unique genetic code, called the genotype. The physical attributes we observe in a creature make up what is called the phenotype, and the environment plays a big role in determining how the genotype will be expressed as a phenotype. A simple example here is the fact that height, a largely heritable trait, has been steadily increasing in humans over the past few centuries.