Semi-inclusive deep-inelastic scattering (SIDIS) process requires the presence of an identified hadron H′ in the final state, which arises from the scattering of a lepton with an initial hadron P. By employing factorization in quantum chromodynamics (QCD), SIDIS provides essential knowledge of hadron structure, enabling the exploration of parton distribution functions (PDFs) and fragmentation functions (FFs). The coefficient functions for SIDIS can be calculated in perturbative QCD and are currently known up to next-to-next-to-leading order (NNLO) for cases where the incoming lepton and the hadron P are either both polarized or both unpolarized. We present a detailed description of these NNLO computations, including a thorough discussion of all partonic channels, the calculation of amplitudes and master integrals for phase-space integration, as well as the renormalization of ultraviolet divergences and the mass factorization of infrared divergences in dimensional regularization, carried out up to NNLO. We provide an extensive phenomenological analysis of the effects of NNLO corrections on SIDIS cross sections for different PDFs and FFs across various kinematic regimes, including those relevant to the future Electron-Ion Collider (EIC). We find that these corrections are not only significant but also crucial for reducing the dependence on the renormalization and factorization scales, mu_R and mu_F, to obtain stable predictions.