Relativistic Dirac and Weyl fermions were extensively studied in quantum field theory. Recently they emerged in the nonrelativistic condensed-matter setting as gapless quasiparticle states in some types of crystals. Notable examples of 2D systems include graphene and surface states in topological insulators such as Bi2Se3. Their 3D implementation is Dirac and Weyl semimetals. Most of the research has been focused on their topological properties and electron transport. However, their optical properties are no less exciting. Optical phenomena provide valuable insight into the fascinating physics of these materials. Optical spectroscopy can provide a cleaner and more straightforward way of studying topological properties of electron states as compared to transport measurements. Moreover, unusual optical properties of these materials can be utilized in future optoelectronic devices. I will discuss several examples illustrating these points. They include (1) extreme optical anisotropy and the optical Hall effect due to both bulk and surface electron states in Weyl semimetals, (2) magnetooptics of Dirac and Weyl semimetals and the optical detection of chiral anomaly, (3) nonlinear optics of Dirac and Weyl semimetals, and (4) the nonlocal nonlinear optical response of 2D Dirac fermions in graphene and topological insulators.