Use Restrictions on your Mac or PC - https://support.apple.com/HT201659 - "Use Restrictions to block or limit certain features and services in iTunes on your computer, including access to explicit content in the iTunes Store."
Click on the link to read how to
Use Restrictions on your iPhone, iPad, and iPod touch - https://support.apple.com/HT201304 - "You can use Restrictions, also known as parental controls, to block or limit specific apps and features on your iPhone, iPad, or iPod touch, including access to explicit content in the iTunes Store."
Use Screen Time on your [or a child's] iPhone, iPad, or iPod touch - https://support.apple.com/HT208982 - "With Screen Time, you can... set limits for what you want to manage."