Massive multiple-input multiple-output (MIMO) is playing a crucial role in the fifth generation (5G) and beyond 5G (B5G) communication systems. Unfortunately, the complexity of massive MIMO systems is tremendously increased when a large number of antennas and radio frequency chains (RF) are utilized. Therefore, a plethora of research efforts has been conducted to find the optimal precoding algorithm with lowest complexity. The main aim of this paper is to provide insights on such precoding algorithms to a generalist of wireless communications. The added value of this paper is that the classification of massive MIMO precoding algorithms is provided with easily distinguishable classes of precoding solutions. This paper covers linear precoding algorithms starting with precoders based on approximate matrix inversion methods such as the truncated polynomial expansion (TPE), the Neumann series approximation (NSA), the Newton iteration (NI), and the Chebyshev iteration (CI) algorithms. The paper also presents the fixed-point iteration-based linear precoding algorithms such as the Gauss-Seidel (GS) algorithm, the successive over relaxation (SOR) algorithm, the conjugate gradient (CG) algorithm, and the Jacobi iteration (JI) algorithm. In addition, the paper reviews the direct matrix decomposition based linear precoding algorithms such as the QR decomposition and Cholesky decomposition (CD). The non-linear precoders are also presented which include the dirty-paper coding (DPC), Tomlinson-Harashima (TH), vector perturbation (VP), and lattice reduction aided (LR) algorithms. Due to the necessity to deal with a high consuming power by the base station (BS) with a large number of antennas in massive MIMO systems, a special subsection is included to describe the characteristics of the peak-to-average power ratio precoding (PAPR) algorithms such as the constant envelope (CE) algorithm, approximate message passing (AMP), and quantized precoding (QP) algorithms. This paper also reviews the machine learning role in precoding techniques. Although many precoding techniques are essentially proposed for a small-scale MIMO, they have been exploited in massive MIMO networks. Therefore, this paper presents the application of small-scale MIMO precoding techniques for massive MIMO. This paper demonstrates the precoding schemes in promising multiple antenna technologies such as the cell-free massive MIMO (CF-M-MIMO), beamspace massive MIMO, and intelligent reflecting surfaces (IRSs). In-depth discussion on the pros and cons, performance-complexity profile, and implementation solidity is provided. This paper also provides a discussion on the channel estimation and energy efficiency. This paper also presents potential future directions in massive MIMO precoding algorithms.