Since a significant fraction of stars are in binary and higher-order multiple systems, binaries are now a critical component in modern astronomy. Close binaries are the origin of many exotic astronomical events in the Universe, including stellar mergers, type Ia supernovae, and gravitational wave events. On the other extreme, wide binaries are easily disrupted by gravitational perturbations, making them a unique tool to probe the Galactic structures. However, the formation and evolution of close and wide binaries remain an unsolved problem, especially because the age of binaries is difficult to measure. In this talk, I will show how we can learn about the age evolution of close and wide binaries from the Gaia stellar kinematics. For main-sequence contact binaries, I will discuss when and how they are born and when they merge. By combining Gaia with LAMOST, I investigate the formation of wide binaries through their metallicity dependence, which may shed light on star formation processes and on the Milky Way substructures. In the end, I will demonstrate how these binaries can help us to understand the mass-radius relation of white dwarfs and planet formation.