The resolution to this issue is often making sure you have entered a credit card or other valid method of payment* even if you don't plan on needing to use it.
If there is an option to select "Review" or "Continue", select that and enter valid payment information if required. If there's problems doing this:
On a mobile device tap: Settings > [your name at the top] > Media & Purchases > View Account > Review Apple ID.
Alternatively this document explains how to 'Change, add, [review,] or remove Apple ID payment methods' on an Apple mobile device, a Mac, or a PC; click here --> Add a payment method to your Apple ID - Apple Support
If you continue to have problems contact Official Apple Support - Select your region from the list and then your country from the pop-up window. If you do not see your country, see if there is an "other" listing for that region.
Apple Support
*Payment methods that you can use with your Apple ID - Payment methods that you can use with your Apple ID - Apple Support
Also note:
Sign in with your Apple ID - Apple Support - at the very bottom: "When you sign in to the App Store and other media services for the first time, you might need to add a credit card or other payment information."