Currently, account closure can be given by submitting physical form . While requesting the same you need to follow the below steps-
There should be no negative balance in your Trading Account. If there you need to clear the due balance.
You need to ensure there are no securities in your Demat account. You can either sell your holdings and withdraw your funds, or you can transfer your shares to another Demat account.
At this moment, we do not have the facility to close your trading & demat account online, we expect to bring that soon.