RMD

I need to take RMD in 2022 and would like to know whether the gains from RMD can be used to offset other 2022 capital loss.