To put it simply, never ever mix your investment to your personal expenses and emergency funds. As an investor, you should know how to manage and allocate your money. Prioritize your personal needs, never max out your money and set up an allocation for emergency purposes. Leave those things which are lucrative that you can live without.
Don't expect that you can just simply pull out the money you have put into an investment. If this is your kind of thinking, then you shouldn't invest in the first place.