How to purchase and sell shares through demat account

How do you purchase and sell shares using a demat account?,