Re: "how can i change the passcode i set for in-app purchases?"
If you use "screen-time", there may be privacy restrictions turned on there.
If needed: Learn how to reset your Screen Time passcode
What to do: If you forgot your Screen Time passcode - Apple Support
To change your app-store settings:
See: Manage App Store purchases, settings, and restrictions on iPhone - Apple Support
Eg: says:
Set content restrictions and prevent in-app purchases
After you turn on content and privacy restrictions, do the following:
- "Go to Settings
> Screen Time > Content & Privacy Restrictions, then turn on Content & Privacy Restrictions. - Tap iTunes & App Store Purchases, then choose restrictions for installing or deleting apps and in-app purchases.
- Tap App Store, Media, Web & Games, then choose age-appropriate restrictions such as the following:
- Apps: Restrict apps by age ratings.
- App Clips: Prevent App Clips from opening."