How can I use the concept of goal-based investing in the stock market?

What is the best way to use the concept of goal-based investing in the stock market?