The Milky Way is a stepping stone to understanding galaxies and the universe. Being a typical galaxy, inferring events in its history helps to develop the overall theory of galaxy formation. Further, since the effects of dark matter are observable in individual stars, the Milky Way provides an excellent setting for testing the nature of dark matter. So far, the progress on these fundamental topics has been made predominantly by studying the spatial distribution of different stellar populations. Now, the Gaia mission is revolutionizing the way we view our Galaxy by delivering precise proper motions, complemented by radial velocity measurements from ground-based spectroscopic surveys like SDSS-V. I will discuss how I dynamically model the 3D positions and velocities that these datasets provide for millions of stars to constrain the formation history of the Milky Way, the small-scale structure of its dark matter halo, and the particle nature of dark matter.