Hi @Gurmanpreet Singh,
Congrats on starting your journey in the world of Real Estate Investing! I wished I started out as young as you! I live in the Bay Area and have a lot of commercial multi-family investments in Sacramento. Yes, my team and I are one of those few who do invest in California and have had success doing it. While it's true, as many have already said over this thread, that California is a state where it's hard to find cash flow, but appreciation is better here when compared to other states. And yes, as some have already mentioned, appreciation can be speculation and might not be the best strategy.
I, however, have a different mindset. I invest for WEALTH, rather than cash flow. The properties we buy enable us to FORCE APPRECIATE the property and increase its NOI. And unlike residential properties. commercial properties are valued based off their NOI. That's why I love commercial multi-family. We've value added and value managed properties at a state where they actually do cash flow. However, those same properties in less than 16 months, we decided to sell because the capital we gained as a result of the forced appreciation would take 20-30 years to gain if we kept for cash flow. And, we can use that capital to get more properties!
So it all depends on your current goals right now. I think house hacking is a great way to start. You can even get a SFH in Sacramento and rent out the other rooms to friends to get your feet wet. Another option is to partner up with others and learn off them to mitigate the risks and share the rewards.
Good luck and enjoy the journey! I hope this helps!