If I sell a stock and take a huge loss, does realizing other gains automatically adjust the cost basis?

Made up figures: suppose I have a net realized loss of $100k in 2019. In 2021, if I sell $100k worth of gains, does my broker usually automatically track this for me? What about TT if i was using it the past three years?