Final answer:
A carbon atom forms covalent bonds with other atoms by sharing electrons in order to achieve a stable octet of electrons in its valence shell, exemplified in compounds like carbon dioxide and methane.
Step-by-step explanation:
A carbon atom forms bonds with other atoms by sharing electrons in order to attain a stable configuration. Specifically, carbon can form up to four covalent bonds because it has four electrons in its valence shell. For example, in carbon dioxide (CO2), carbon forms two double covalent bonds with oxygen atoms, sharing two pairs of electrons with each oxygen. In other compounds, such as methane (CH4), carbon shares a single pair of electrons with each hydrogen atom, resulting in four single covalent bonds. The goal in each case is for carbon to achieve an electron configuration with eight valence electrons, satisfying the octet rule.
During the formation of a molecule like carbon dioxide (O=C=O), the atoms involved share electrons to obtain the electron configuration that makes them most stable. Initially, when a carbon atom has only six valence electrons, it is unstable. The formation of a double bond with an oxygen atom, which contributes a lone pair of electrons, allows carbon to have an octet of electrons and thus reach stability.