Your 40s should hopefully be the time where you're approaching, or are at, your peak earning potential.
Kids, a mortgage and marriage will probably take up a big chunk of your money, but with your highest earnings there will hopefully be some money for investing.
Most people will be a few decades from retirement and even further away from being six feet under, so it's far too early to withdraw everything as cash and stuff it under the mattress.
However, it's also probably a good age to start heeding one of Warren Buffett's most famous and wise quotes: Rule number one don't lose money, rule number two don't forget rule number one.
I believe that people in their 40s need to invest for growth. Slow-growth, high-yielding stocks aren't likely to generate strong returns. One idea could be BETANASDAQ ETF UNITS (ASX: NDQ), it's an index which gives concentrated exposure to all of the top tech shares in the US like Apple, Alphabet (Google), Facebook, Amazon and Microsoft. The nature of the index fund means that the risk is diversified instead of being invested in just Apple.
Other options could be businesses that lead their industries but should be able to keep growing as profit margins increase and they expand overseas, such as REA Group Limited (ASX: REA), Seek Limited (ASX: SEK) and Altium Limited (ASX: ALU).
Another idea could be to invest in shares that benefit from the ageing population like Challenger Ltd (ASX: CGF) and Ramsay Health Care Limited (ASX: RHC) because you have the time to see the thematic play out.
Another idea could be to invest in food-related shares. The Australian and global populations are predicted to continue rising for a long time to come, which should lead to rising food prices. Two options to place this theme could be Costa Group Holdings Ltd (ASX: CGC) and BetaShares Global Agriculture ETF (ASX: FOOD).
Foolish takeaway
The 40s is the beat time to set yourself up for a good retirement. High earnings whilst having decades for compounding is a good combination.