The ability to control spins by electric fields could enable much more energy-efficient information technology. The concept has been explored in a wide variety of materials including dilute magnetic semiconductors, ferromagnetic metal thin films and multiferroics. The recently emerged atomically thin magnetic materials present new opportunities to explore electrical control of magnetism in the 2D limit and to realize new device concepts in van der Waals heterostructures. In this talk, I will discuss the science of electrical switching of magnetism in 2D materials and its applications on controlling spin dynamics in both the ultraslow and ultrafast timescales. In particular, the ability to control critical spin dynamics has allowed us to develop a new concept of passive magnetic switching using information from measurements as a resource. The concept could enable much more energy-efficient magnetic switching technology.