Blender Secrets - Make a Flag
Make a flag-shaped plane with enough subdivisions add the vertices on one end to a vertex group.
Add a Cloth modifier and add the vertex group to the Pin Group.
Start playing the simulation by pressing Spacebar. Add a Force > Force or Wind to the scene, either will work.
Add some more force to the wind.
Experiment with the vertex mass. This value depends on your object.
You can experiment with the different presets.
Turn on self collisions so the flag doesn't intersect with itself.
You can use the Import Images as Planes add-on to import your flag image.