The concept of a magic wavelength, at which two atomic states experience the same ac Stark shift in a light field, was first proposed for applications in optical atomic clocks. The subject of magic wavelengths has since become of great interest owing to a variety of other applications including laser cooling of fermionic ultracold gases with high phase-space densities, trapping and controlling atoms in high-Q cavities in the strong coupling regime, and implementation of quantum computing protocols. Recently, another related quantity became of much interest: a magic-zero, or tune-out wavelength. At the magic-zero wavelength, atom polarizability vanishes and it experiences no dipole force and thus is unaffected by the presence of an optical lattice leading to interesting application in quantum information and precision measurements. In this talk, I will discuss our recent calculations of magic and magic-zero wavelengths in alkali-metal and divalent atoms and their applications.