Carbon has an atomic number of 6, which is an indicative of the number of electrons and protons.
According to the rules determining electronic configuration (Aufbau, Pauli, and Hund), these electrons are arranged in the 1s, 2s, and 2p subshells of the Carbon atom to give the complete electronic configuration - 1s2 2s2 2p2. This electronic configuration of Carbon, where the electrons are in their lowest energy states and closest to the nucleus, is called the ground state electronic configuration.

The last shell - 2p2 is Carbon’s outermost shell, also known as the valence shell. In bond-forming reactions, only the valence shell participates.
If only valence shells participate in bonding reactions, then Carbon should only form two bonds using its two unpaired electrons. However, Carbon forms four bonds, as seen in CH4, CH3X, H2C=O, and O=C=O molecules. This discrepancy between the number of valence electrons of an atom and the number of bonds it forms (valency) is explained by the hybridization concept, an extension of the Valence Bond (VB) Theory.
Related Reading- How many covalent bonds an atom can form? Valency in Organic Chemistry
Hybridization rationalizes the covalent bond formation to the excitation of electrons (not always) to give more unpaired electrons and the mixing of atomic orbitals close in energy to form newer, improved hybrid orbitals. These hybrid orbitals are then used for the bond formation process.
In the example of Carbon, the hybridization concept proposes the excitation of the 2s electrons to the 2p level to obtain a new electronic configuration of Carbon as 1s2 2s1 2px1 2py1 2pz1.

The mixing of 2s1 2px1 2py1 2pz1 forms four equal energy sp3 hybrid orbitals. These orbitals then arrange themselves in tetrahedral geometry, keeping an angle of 109.5o between them (VSEPR theory, an extension of the Valence Bond Theory, explains molecular shapes).
The single unpaired electrons in these sp3 hybrid orbitals then overlap with the s-orbitals of the substituent (H in the case of CH4) to form a sp3-s single covalent (sigma) bond.

So, the central carbon atom becomes sp3 hybridized to form four bonds with four Hydrogen atoms.
Another shortcut to determine hybridization is by finding the steric number and correlating the number with hybridization, though there are exceptions to this method of prediction.
This excerpt is inspired by the chapter Covalent Bond part of CurlyArrows' Introductory Organic Chemistry Course. Preview the Book.