If you struggle to get the flag, start with both knees tucked as shown in the top picture. If even that is too difficult, it's all about oblique work, oblique work and more oblique work. Master those side plank variations!
Progression 2: One knee tucked and one leg straight. Once that's mastered, the strength will progress to both legs straightened out.