How to purchase shares through demat account

What steps are involved in buying shares using a Demat account?