Evidence supports associations of lifestyle–including diet and physical activity—and weight with cognitive functioning, but the pathways responsible for these associations have not been fully elucidated. Because healthier lifestyles have been associated with better left atrial structure and function, which in turn is associated with better cognitive functioning, we tested the hypothesis that left atrial structure and function is a potential mediator of the association between lifestyles and cognition. We included 476 participants with overweight or obesity and metabolic syndrome from three centers in Spain who underwent lifestyle assessment and transthoracic echocardiography at baseline and had repeated measurements of the Trail Making A test, a measure of executive function, at baseline and at the two-year follow-up. We conducted mediation analyses to test if measures of left atrial structure and function mediated associations between adherence to the Mediterranean diet scores, physical activity, or weight at baseline, and two-year change in Trail Making A scores. The analysis did not find an effect between these factors and Trail Making A scores, and no indirect effects mediated through the echocardiographic measurements. The modest sample size in this analysis is a limitation, and larger studies should be conducted to determine potential cardiovascular factors mediating the association between lifestyle and cognition.