Beamforming is the process of generating a directional beam from an antenna array. Achieve beamforming by weighting individual elements by using sidelobe control or beam scanning.
Side lobes are undesired and lead to reception or transmission of energy in unwanted directions. Side lobe control in an array is achieved using amplitude taper or amplitude weighting. Amplitude tapering changes the excitation amplitude of each element in the array. Minor lobe levels are controlled using amplitude taper that runs from the center of the array to the end of the array. Smoother amplitude tapering gives larger small side lobe levels but half-power beamwidth. These arrays are non-uniformly excited arrays.
Consider a linear array of 21 elements. Without amplitude tapering, the array contains unwanted side lobes in the desired direction:
By using amplitude tapering on the linear array, you control the side lobes and achieve a better main beam in the desired direction:
Beam scanning is the movement of a radiation pattern in space. You can achieve beam scanning by controlling the progressive phase difference between the elements to direct the beam in any desired direction. The phase shift changes the phase of the excitation currents of each element in an array. You can achieve this phase shift using phase sifter devices, a time delay, frequency scanning, beam switching, or digital beamforming.
Consider a linear array of 21 elements where peak directivity is shown without beam scanning:
To scan the beam at a specific angle, use phase shift on the linear array:
 Stutzman, W.L. Thiele, G.A. Antenna Theory and Design, 3rd Edition. New York: Wiley, 2013, p. 307.