How to create demat and trading account

How do I create both a Demat and trading account together?