Cloth

Subdivide the object which becomes the cloth as many as your computer spec allows.

cloth1's photo

Select the object that becomes cloth > Physics Properties > Cloth

cloth2's photo

Select the object that becomes the obstacle > Physics Properties > Collision

cloth3's photo

Physics Properties > Check "Self Collisions" > Play the animation

cloth4's photo