Go to your WordPress dashboard > Select Widgets > Click on the Add element + And then, search for code, and you will have the choice of adding in code, shortcode, or HTML. Then, simply go to your Ad platforms [Like Google AdSense, Mediavine, etc] and get the shortcode [Or code or HTML], and simply insert it.