The prevalence of depression and anxiety among healthcare workers (HCWs) during the Covid-19 pandemics is high. The aim of the study is to identify the importance of self-esteem and occupational factors in association with the incidence of depression and anxiety among HCWs through a longitudinal cohort study during the Covid-19 pandemics in Latvia. Participants were interviewed repeatedly seven times during the Covid-19 pandemics. 322 participants were included in the data analysis for depression and 352 for anxiety. Low self-esteem and working in the general practitioner's office is associated with the incidence of depression and anxiety. Undergraduate education and direct contact with Covid-19 patients are associated with the incidence of depression. The risk of anxiety decreases by 1% each year among HCWs. Our study shows the importance of personality factors of HCWs during the Covid-19 pandemics.