How to buy shares through demat account

What are the steps to buy shares through a Demat account?,