A metalens is an ultra-thin lens made of a metasurface, with focusing and imaging functions, and with promising applications in miniature optical systems, such as mobile devices. This paper gives an introduction to the optics of metalenses. First, we examine the focusing and imaging characteristics of metalenses. And then, as an essential step, we derive the refraction law of metasurfaces from the Huygens´s principle. It is then that some basic formulas of the metalens, for focusing and imaging, are derived at a level appropriate for undergraduate students. We begin with the derivation of the phase profile of a metalens. Then we derive the lens equation of the metalens, which relates the object and image distance in a metalens. The paper closes with a discussion of the relationship between the metalens and the classical refractive lens.