The Localization of a magnetic skyrmion on a nonmagnetic defect in a two-dimensional triangular lattice is investigated within the framework of the generalized Heisenberg model, which includes exchange, anisotropy, Dzyaloshinskii–Moriya interaction, and interaction with an external magnetic field. It is shown that there is a threshold magnetic field, below which there are two locally stable positions of the defect inside the skyrmion. The energy difference between the states with a different localization of defects results in a fine energy structure of skyrmions, depending on the strength of the magnetic field.