I had the same issue the only thing different is that mine was on the left side.
Get a pry tool to get under the out side cover of the headphones.
I don’t how it is set up on the right side, but if you doing the left side be careful of the wires since all the cables for the buttons are there.
I recommend to start prying up in the round part, since the band part is thinner and it might break easily since is not loose yet.
Once you open it, place the metal slide back into the track and snap everything back into place. Make sure you don’t have the headphones extended when you putting the outside cover back into place