How can I get this curtain to open and close realistically?
Here's a way to get you started,
Subdivide a grid or plane well and select some vertices that would be where the &quot;rings&quot; would go into the curtain. (a bit randomness is okay I suppose)

Add these selected vertices to a vertex group to be used by the cloth modifier for pinning.

Create a Shape Key and for the second key scale the pinning vertex group towards the cursor the direction the curtain will open.

Add cloth and subdivision surface modifiers.
For cloth settings, default is mostly okay aside from adding self collisions and pinning vertex group.

Next animate the shape key from 0 to 1 and you should end up with a result similar to below:

Here's a file to play with: