Please check if in-app purchases are restricted on your device:
Go to Settings → Screen Time → Content & Privacy Restrictions.
Turn on Content & Privacy Restrictions if it’s disabled.
Navigate to iTunes & App Store Purchases.
Ensure that In-app Purchases is set to "Allow."
Also make sure you’re signed in with the correct Apple ID that has a valid payment method:
Open Settings → [Your Name] → Media & Purchases → View Account.
Verify the payment method and ensure it’s active and working.
Also ensure the country set in your Apple ID matches the region you are currently in.
These tips might be helpful as well:
Restart your device and try again.
Ensure both the app and iOS are updated to the latest version.
If you’re part of a Family Sharing group, check if the organizer has restricted your ability to make purchases.