How to repair leak between P-trap arm and drain pipe
It looks like that reducer is cemented on to a 22 1/2 degree sweep and separating them will really a job. You best bet would be to remove both those pieces because you don't know exactly which piece is leaking. Cut that second piece where it comes out of the wall as close to the bent as possible to save as much of the protruding pipe so you can cement a new piece on to it. You might have to chip a little wall away to expose more pipe. then get the piping you'll need to reconnect everything, maybe clean it up a bit. that cement will work fine with the ABS piping.