Before you buy/sell stocks, you will need to first transfer funds to the trading account using online payment gateway, NEFT/RTGS or cheque.
When you want to withdraw any money, you will have to login to the bacoffice and place a withdrawal request, and this will be in your bank account within 24 hours. Check this link for more.
Pay In to your trading account => Payment Gateway through Internet Banking, you type your internet banking login and password and transfer
Pay Out from your trading account => You setup money withdrawal request in backoffice. A NEFT transfer will be initiated from your Broker Account to your bank account