You need to maintain applicable margins for the day. This will be applicable from the expiry week. If you have margins then you can either choose to close the position before expiry or take physical delivery.
If you don’t have the required margins then the positions will be squared off as per the policy.
During the expiry week, you will be alerted on the order window about the same. You can watch out for such nudge messages to avoid such risks.