Insomnia, a widespread concern among the populace, frequently prompts questions about the determinants of sleep quality. Addressing these queries, the study meticulously examines the impact of various lifestyle factors on sleep. This paper utilizes a comprehensive dataset from Kaggle, encompassing an array of lifestyle habits and their corresponding sleep quality metrics. Through the application of a linear regression model and the robust bootstrap method, the analysis has brought to light a substantial scientific link between lifestyle choices and the quality of sleep. The findings are revealing: key factors such as age, the extent of physical activity, and the number of steps taken daily exhibit a positive correlation with enhanced sleep quality. In stark contrast, this paper observes that elevated stress levels and increased systolic blood pressure negatively impinge upon sleep. Intriguingly, the study further reveals that sleep quality is not uniform across the board; it varies significantly with gender differences and Body Mass Index (BMI) levels. These insights underscore the multifaceted nature of sleep quality, influenced by a tapestry of lifestyle elements. The research contributes to a deeper understanding of sleep dynamics, offering valuable perspectives for improving sleep health in the society.