To prevent unauthorized or accidental purchases, you will need to adjust the settings in your device's App Store or Google Play Store.
For iOS devices: Please refer to Apple's support article on managing your iTunes Store and App Store password preferences to learn how to secure your device found here: https://support.apple.com/en-us/HT204030
For Android devices: Please check Google Play's support article on how to require a password or authentication for purchases to secure your device found here: https://support.google.com/googleplay/answer/1626831?hl=en