The field of metasurfaces is revolutionizing the way we control and manipulate light and electromagnetic fields based on engineered ultrathin structures. In this review article, we discuss the theory, modeling, and applications of metasurfaces, with particular focus on controlling the near-field response of sources close to the artificial surface. Although metasurfaces have attracted large attention for their ability to control and mold the wavefront of propagating waves, hence acting as flat lenses, they can also be used to modify the emission/radiation from near-field sources and control the generation and propagation of surface waves guided and confined along the surface. We discuss the analytical modeling of metasurfaces treated as homogenized impedance sheets and elucidate the application and limits of this approach for near-field sources. We devote a large part of the review article to anisotropic and hyperbolic metasurfaces, which enable some of the most exciting and extreme examples of anomalous surface-wave propagation on planarized artificial structures, with important implications for light focusing, confinement, and subwavelength imaging. We also connect these ideas with the emerging area of 2D materials and discuss how to implement hyperbolic metasurfaces with graphene and black phosphorus. We hope that this review article may provide the reader with relevant physical insights and useful analytical tools to study metasurfaces and their near-field interactions with localized sources and, more generally, offer an overview of this field and its ambitious goal of ideal light control on a surface.