How to debug reinforcement learning

How to debug reinforcement learning

I am implementing reinforcement learning myself, but it does not work well
I use pytorch The environment is Pendulum-v0

Even if you print plt the variable, you do not know whether it is the correct value
It’s difficult to separate each function,
I don’t know if the hyperparameters are bad or the implementation is wrong

Is there any good debugging method?