Gravity plays a crucial role in maintaining the equilibrium of stars by balancing the inward pull of gravitational forces with the outward pressure from nuclear fusion reactions. This balance allows stars to produce energy consistently over their lifetimes. In planet formation, gravity facilitates the accumulation of dust and gas in protoplanetary disks, leading to the coalescence of material into larger bodies. The gravitational attraction among particles in these disks is essential for the formation of planets. Understanding these dynamics is fundamental to astrophysics and the study of celestial bodies.