Mathematics and statistical skills are essential in our daily lives. However, many students struggle to grasp these concepts. This research aimed to explore the relationship between attitudes towards mathematics and statistics and emotional dimensions such as anxiety and self-efficacy. The study included two groups: 276 Spanish university students from various disciplines at the University of Granada, and 19 secondary school students from a public school in Granada, Spain. The results indicated that anxiety had a negative impact on attitudes, while self-efficacy had a positive effect. This suggests the importance of emotional education in improving well-being and mathematics instruction.