I have a brand new LG G5 phone and randomly ads will pop up. The ads started appearing before I installed any app. How do I get rid of them?
You could try sideloading the Adblock Plus (ABP) app. You need to enable unknown sources and download it from their website as it is not on the google play store. Go to this link: https://adblockplus.org/android-install to download it, and click on "Download Adblock Plus for Android" at the end of the text, or resetting your phone.
You can install DNS66 which uses DNS-blocking methods. It creates a VPN tunnel on your device and has to work in the background though. According to user reviews it won't drain your battery that much. Free and Open Source: DNS66 - F-Droid. The process is simple. Enable 'Unknown Sources' under Security settings, download the app from the link I gave, and install it by clicking on it on your file browser. After entering the app you can see that you can set it up so it launches at your device startup. You can disable IPv6 support if it's not supported in your area. And you should enable Watch connection. At the hosts tab you can add different hosts files. Adaway has a good hosts file, and you can enable Malware hosts too for increased security. There are very good paid alternatives too, like AdGuard for Android or Blokada. Those should work.