Magnetic impurities placed in the superconductor can lead to emergence of the Yu-Shiba-Rusinov bound states. Coupling between the impurity and the substrate depends on density of states (DOS) at the Fermi level and can be tuned by DOS singularities. In this paper, we study the role of DOS singularities using the real space Bogoliubov-de Gennes equations for chosen lattice models. To uncover the role of these singularities (Dirac point, van Hove singularity, or the flat band), we study honeycomb, kagome, and Lieb lattices. We show that the properties of the Shiba state strongly depends on the type of lattice. Nevertheless some behaviors are generic, e.g. dependence of the critical magnetic coupling on the DOS at the Fermi level. However, the Shiba states realized in the Lieb lattice exhibit extraordinary properties, which can be explained by the presence of a few nonequivalent sublattices. Depending on the location of the magnetic impurity in the chosen sublattice, the value of critical magnetic coupling $J_\text{c}$ can be reduced or enhanced when the flat band is located at the Fermi level. In this context, we also present differences in the local DOS and coherence lengths for different sublattices in the Lieb lattice.