Stock wash sale

I have some stocks that have almost lost all their value over the past three years. I held onto them to use the losses to offset my gains from company stock. For example, if I sell these stocks at a $30,000 loss (held for more than three years) and sell my company stock with a $50,000 short-term capital gain, would I only need to pay capital gains tax on the $20,000 net gain (50k - 30k) this year? Additionally, if I repurchase my company stock immediately after selling, would this trigger a wash sale and prevent me from resetting the cost basis on the company stock? I am optimistic about my company’s stock, but I want to leverage its growth to offset my losses on other investments.