@enclaust wrote:
....what if I sell a stock but I don’t withdraw the money....?
Any gain (or loss) is still recognized regardless of what you do with the proceeds, whether that involves spending the proceeds, purchasing other stock or securities, or just leaving the proceeds in cash in your account at the brokerage firm.
In short, the capital gains would still be subject to taxation but note that such gains would ordinarily not have any adverse impact on your unemployment benefits.