Offsetting Long-Term and Short Term Gains

Which is better: to offset short-term gains with long-term losses, or to offset long-term gains with short-term losses?

 

Should we try and match up our short-term gains with short-term losses and the same for long-term gains and losses?

 

Does it even matter?

 

My situation: I have about $5K ST gains and $35K LT gains already booked for 2022. I have 2 stocks with losses -- both with ST and LT on each -- and I don't think they will recover so quickly. The sale of the two would only cover a portion of the ST gain, and cover $13K of the LT gain. (I am not so worried about taxes on LT gains since they are taxed at 15%).

 

Should I try to find another ST loss to offset the ST gain above, or will the LT loss be applied and cover the remaining ST gain -- so I am only taxed on the uncovered LT gain at the lower rate?