One crucial requirement for power systems is the necessity to enhance flexibility, enabling the seamless integration of a substantial amount of renewable energy generation. While flexibility holds significance in current power systems, the escalating penetration of renewable energy resources emphasizes an ongoing and growing need for flexibility in the future, given the intermittent nature of these energy sources. To address the crucial aspects of decarbonization for sustainable development and recognizing decentralization as a strategy for grid development, this research concentrates on flexibility in the context of microgrids. Diverging from many existing review papers that explore flexibility in the broader power system context, this study pioneers an investigation from the local energy system's perspective, introducing a novel classification of flexibility resources. The exploration begins with elucidating various concepts and definitions of flexibility. Subsequently, flexibility resources available to microgrids are systematically categorized based on the operation modes. A comprehensive review of conducted research follows, highlighting diverse categories and emphasizing primary flexibility resources. Special attention is given to recent concepts such as power-to-gas/hydrogen conversion, using electrolyzers as flexible loads for (green) hydrogen production, and various storage devices, as they offer flexibility during both off-grid and grid-connected operation modes in microgrids. Furthermore, a comparative analysis is undertaken, detailing the objective function(s) and flexibility resources employed in different research studies. To quantify flexibility, the latest metrics are categorized and explained. The study concludes by presenting suggestions for future research directions and summarizing key findings.