Pretty easy, but depends on the marketplace you use.
1. Create the IAP entries in the marketplace (Google, Apple, etc...) Just create an IAP item give it a price and Name.
2. In your game create a global variable (Something like ShowAds)
3. By default when your game is played in the logic that would show your ads add a condition for Showads = True (or = 1).
4. When Users purchase the IAP from the marketplace (you need to add the events to display and purchase the IAP - Different depending on your platform - CocoonJS, Ejecta, etc...) Set the ShowAds variable to 0 or false.
5. Add an event to the games first layout (main menu or splash screen) to check if the IAP is purchased and set the ShowAds variable based on that.
6. If you want to take care of users who bought the IAP and have to reinstall or switch phones, then you need to check to see if the IAP was previously purchased (Refresh Purchases).
Again this is just the rough steps, but the specifics really depend on what you are using, cocoonjs, ejecta, and what store you are on google play, iTunes, etc...