I copied this code from their docs: https://docs.unity.com/ads/ImplementingRewardedAdsUnity.htm
I doesn't make sense _adUnitId is defined and it says it's not defined.
@siusiulala is right I had to put the code in a function so I put it in awake function for it to work.
Alternatively change to release mode from debug and error should disappear.