disable Google Play Services and the Google Play Store. And that will help a lot. And if you still need apps from the Google Store, you can use the Aurora Store from f-droid
Edit: you may also want to look into controld.com since their free dns blocks known malware, ads, and trackers. They have several options including standard DNS, DNS over HTTPS, and DNS over TLS, and Android supports DNS over TLS. So you can use it directly.
Personally i use proton with my own domain