How to invest in demat account online

What are the best ways to invest online using a demat account?