In recent years, many countries have faced challenges balancing food production and the increasing needs of the rapidly growing population and large-scale urban development. This situation reflects the importance of food security in overcoming food shortages. Food security allows every citizen to acquire the same amount of nutritious food to survive and lead a healthy life. The concept of sustainable gardens is the best way to improve food access and increase food resources to ensure food security. This study examines primary school pupils’ level of understanding and attitude towards food security through the implementation of sustainable gardens. In this study, pupils’ understanding of food security means they understand that it entails access to the same physical, social, and economic resources and adopting a healthy and active lifestyle. In terms of attitude, sustainable gardening activities can help pupils provide feedback openly and influence them to adapt these practices to their social environment. This study aims to measure pupils’ level of understanding and attitude. The quantitative component of this study was conducted in nine selected national schools and involved three hundred and thirty-five respondents. The findings of this study demonstrate the pupils’ level of understanding and attitude towards food security through the implementation of sustainable gardens. It was found that the primary school pupils showed a high level of understanding and positive attitude. This study’s findings can guide education stakeholders toward the next step in sustainable practices. The study results suggest the need to conduct further studies to examine the development of pupils’ understanding and attitude towards implementing sustainable gardens to address food security issues. This study allows all parties to curb food security threats by implementing sustainable gardens.