With just a couple of days left in the trading year, all the major markets are posting significant gains. At this time in 2022, not many investors would have taken that side of the bet. So, what lessons should investors take away after a volatile and unpredictable year in stocks? For starters, 2023 was a good reminder to invest in the market that is, not what you think it should be. To put that in terms that any parent with a teenager will understand: Trust but verify. At more than one point this past year, you would have believed a stock market crash not seen since 1929 was around the corner. Yet, every time, equities got off the mat, dusted themselves off and moved higher. And as the year comes to an end, there are billions, if not trillions of dollars re-entering the market. But are those dollars chasing overpriced stocks, or are they going after small-cap stocks with a lot of potential but no proven track record? And where should investors be thinking about putting their money in 2024? Here are some thoughts on the lessons a year in stocks can teach us. There’s a Reason Why Nvidia Is Just Getting Started Many investors aren’t sure what to make of the artificial intelligence ( [AI](https://investorplace.com/stock-quotes/ai-stock-quote/)) boom. On the one hand, to paraphrase writer Alan Saunders, AI is an example of life happening while we are busy making other plans. That is, we’ve known about AI for some time, yet the ChatGPT phenomenon made it impossible to ignore. The question is: Will it be friend or foe? Like all technological advances, it will likely be a little of both. As much as well-intentioned regulators will try, there will be bad actors with equally bad intentions. That’s troublesome. But on balance, AI will be transformative in how we interact with technology. And by we, I mean many who find today’s technology limiting. That means, like the internet, it’s a net win. That’s why companies are rushing to get in on AI. It’s not going to be a nice-to-have, it will be a must-have. And it’s also why companies like Nvidia (NASDAQ: [NVDA](https://investorplace.com/stock-quotes/nvda-stock-quote/)), Advanced Micro Devices (NASDAQ: [AMD](https://investorplace.com/stock-quotes/amd-stock-quote/)) and other [chip companies will flourish.](https://investorplace.com/2023/12/the-winners-and-losers-2023-stock-market-performance-review/) This is the beginning of a super cycle, and there’s still a lot of runway ahead. The Death of the Consumer Was (Mildly) Exaggerated Part of analyzing a year in stocks is identifying the best and worst sectors. At the beginning of the year, conventional wisdom was that consumer staples would do well and [consumer discretionary stocks](https://investorplace.com/industries/consumer-discretionary/) would struggle. In fact, the opposite occurred. Consumer staples have been the second-worst-performing sector. The companies performed well enough, but investors starving for growth [shifted to high-flying tech stocks.](https://www.fidelity.com/learning-center/trading-investing/outlook-consumer-staples) Meanwhile, consumer discretionary stocks are up nearly 20% as demand for travel and recreation remains strong. Is this demand being fueled by reckless spending that will come crashing down when the credit card bills come due? That’s been predicted for some time, and it hasn’t happened yet. The takeaway for investors is two-fold. One, don’t bet against the consumer. And two, be selective. Just because the consumer staples sector underperformed doesn’t mean there were no winners. Conversely, many consumer discretionary stocks really did face some tough times. Demand Delayed Is Not Demand Denied The energy sector did not perform as expected. For starters, the renewable energy movement is still struggling to get off the starting blocks. The solar sector is a good example of why even government subsidies can’t change the basics of supply and demand. The same could be said of electric vehicles. Yet, oil and gas stocks have been laggards as well. In September and October, crude oil prices near $100 were considered a certainty. But as the year comes to an end, crude oil is closer to $70. In both cases, investors should look at this as a case of demand delayed, not denied. In December, the Federal Reserve all but ensured interest rates would be cut in 2024, more than once — most likely. When that happens, oil demand will rise and, with it, the price of crude oil. An improving economy will also be a boost for renewable energy companies, which will benefit from [lower capital costs.](https://www.nytimes.com/2023/12/05/climate/renewable-energy-inflation-climate-cop28.html) On the date of publication, Chris Markoch did not hold (either directly or indirectly) any positions in the securities mentioned in this article. The opinions expressed in this article are those of the writer, subject to the InvestorPlace.com [Publishing Guidelines.](https://investorplace.com/corporate/investorplace-publishing-guidelines/)