Although the role of social media in infectious disease outbreaks is receiving increasing attention, little is known about the mechanisms by which social media use affects risk perception and preventive behaviors during such outbreaks. This study aims to determine whether there are any relationships between social media use, preventive behavior, perceived threat of coronavirus, self-efficacy, and socio-demographic characteristics. The data were collected from 310 respondents across Pakistan using an online cross-sectional survey. Reliability analyses were performed for all scales and structural equational modeling was used to identify the relationships between study variables. We found that: (i) social media use predicts self-efficacy (beta = 0.25, p < 0.05) and perceived threat of coronavirus (beta = 0.54, p < 0.05, R (2) = 0.06), and (ii) preventive behavior is predicted by self-efficacy and perceived threat of coronavirus (R = 0.10, p < 0.05). Therefore, these results indicate the importance of social media's influence on health-related behaviors. These findings are valuable for health administrators, governments, policymakers, and social scientists, specifically for individuals whose situations are similar to those in Pakistan.