This study has identified heterogeneity in loneliness, emphasising the need for a diversified intervention approach. Sleep quality has a protective effect on loneliness and is easy to assess, making it an important intervention tool. In addition, it is imperative to account for the influences of age and cohort effects when formulating intervention strategies.