The critical point to remember is that the earlier in your life do you start investing in shares, the better the returns you can generate.
The money that you use to buy shares must necessarily be money that you do not need in the next three to four years. So you can start investing only when you have surplus money (after taking care of personal debts if any). Never borrow to invest in the stock market.
The surplus money that you have should be invested wisely in shares to reap the rewards. Of course investing is risky. Higher returns always come with higher risks. However the risks of investing need not deter one. After all, the rewards outweigh the risks.
A ship is safest in the harbour, but it was never built to stay anchored. Similarly, your surplus money is meant to create wealth for you. And it can't generate wealth for you unless you invest it in shares.