BACKGROUND: The coronavirus disease 2019 pandemic has had an ongoing impact on the public's mental health that requires long-term attention. Exploring the relationship between mental health indicators would aid in identifying solutions to improve public mental health. AIM: To investigate the prevalence of anxiety, depression, and insomnia and explore the relationship among neuroticism, cognitive failures, and mental health. METHODS: A cross-sectional survey was conducted in December 2023 using an online platform to recruit adult participants. The neuroticism, subjective cognitive function, and mental health of the participants were assessed using the neuroticism subscale of the Chinese Big Five Personality Inventory Brief Version, cognitive failures questionnaire, generalized anxiety disorder-7, patient health questionnaire-9, and insomnia severity index. Pearson's correlation analysis, independent samples RESULTS: A total of 1011 valid questionnaires were collected, of which 343 were completed by male (33.93%) respondents and 668 were completed by female (66.07%) respondents. The rates of anxiety, depression, and insomnia were 41.3%, 44.6%, and 36.3%, respectively, most cases of which were mild. Among the mental health indicators, there were significant differences by age and between those with siblings and those who were only children. Neuroticism and cognitive failures were significantly positively correlated with mental health indicators. Further moderated mediation analysis showed that cognitive failures mediated the relationship between insomnia and anxiety and between insomnia and depression, with neuroticism moderating the first half of this pathway and the effect being greater in the low-neuroticism group. CONCLUSION: Cognitive failures and neuroticism play important roles in mental health. Therefore, enhancing subjective cognitive function and regulating emotional stability may contribute to the improvement of mental health.