It makes a huge difference how big the company is, and how easy it is to sell shares. (I am also making the fundamental assumption the company is public, if it is not then there is no guarantee at all you can ever sell the shares). If your company is traded on a major exchange, and there are lots of shares traded per day, the it is likely you will be able to sell them when you need to at a competitive price (subject to any restrictions they place on you as an employee to sell).
Large publically traded companies in the US call this an "Employee Stock Purchase Plan" and if this is offered as part of an ESPP, then the company is likely large enough to count.
Then, there is a separate matter of whether the company is a good investment at all. And even if it is, you may not want to invest in your employer at all, because your salary is already tied into their performance, and you may not want to tie your investment strategy in to the same company. However, there is nothing preventing you from selling ESPP shares as soon as your company lets you do it after purchase, and if you do that you can get an immediate guaranteed return, with very little risk. You will have to pay taxes on your profit, but not the money you put in to buy shares.
It makes your taxes a little more complicated, but not overly so, and you may clear enough to pay an accountant to do your taxes anyway.