Cellular networks have to minimize the interference among network users in addition to maximizing their individual data rates. From this perspective, beamforming is the core technology behind the design of the 5G physical layer. In this tutorial, we start from the basic signals and build the fundamental ideas on which physical and virtual beamforming methodologies are based. We will explore how its integration with massive MIMO leads to a simple yet efficient system. No prior DSP knowledge is required to understand the concepts.