Question to Wash Sale

I have held my corporate stock for a long time, which suffers a significant loss. I want to gradually exit the position to offset capital gains from other stocks.  But my corporate grant distribution may trigger the Wash Sale rule. For example, if one grant is expected to distribute on Jan 31st, 2021,  what are the transaction windows to avoid the Wash Sale? Also, does the Wash Sale refer to a transaction or settlement date? They are a few days apart. 

 

Thanks for your help.