Approach any registered depository participant (DP) to open your Beneficiary Account either with NSDL or CDSL. You cannot open the demat account directly through NSDL or CDSL but only through their registered representatives in the form of DPS. Ideally, let your broker and your DP be the same entity as that will facilitate transactions with greater simplicity. Once your account is opened your BO account number is allocated to you, you are ready to dematerialize your physical shares.
When you open your demat account, you can either opt to open an account with NSDL or with CDSL. The choice is yours. Of course, there is some basic documentation to be done while opening your account. You need to give proofs of residence and proof of identity to open your demat account. Also, your PAN card and your photograph have to be submitted. Typically, your trading and the demat account is opened at the same time to avoid any mismatch between the two accounts and enable easier mapping.