Children and adolescents are not indifferent to the dramatic impact of the COVID-19 pandemic, and the need to be forced to live in confinement. The change in life to which they have been abruptly subjected forces us to understand the state of their mental health in order to adequately address both their present and future needs. The present study was carried out with the intention of studying the consequences of confinement on anxiety, sleep routines and executive functioning of 1,028 children and adolescents, aged from 6 to 18 years, residing in Spain to; assess if there are differences regarding these consequences in terms of sex and age; how anxiety affects executive functioning in males and females; and to examine the possible correlations between the measured variables. For this purpose, an online questionnaire containing five sections was designed: the first section gathers information on sociodemographic and health data, while the following sections gather information from different standardized scales which measure anxiety, sleep and executive functions, whose items were adapted in order to be completed by parents, and/or legal guardians. The statistical analyzes carried out highlights significant differences in executive functioning between males and females. In turn, in regards to age, greater difficulties were detected in anxiety in the 9 to 12 age group and greater sleep disturbances between 13 and 18 year olds. On the other hand, significant differences were found in intra-sexual executive functioning depending on whether they presented greater or lesser anxiety, with executive functioning being more tendentiously maladjusted in males than in females, revealing a significantly relevant effect size (p = 0.001; ω2 = 0.27 BRIEF-2; ω2 = 0.19 BDEFS-CA; 95%). Positive correlations are obtained between state anxiety and sleep and executive functioning alterations. Finally, through Path Analysis, it is verified that state anxiety is the variable with the greatest weight within the model that would explain the alteration in the executive functioning of the present sample.