What you are after is a cookie management solution and not necessary how to make your tracking compliant with cookie selection (which will come after you install cookie banner/management solution).
Other answers referrer to Adobe Visitor ID services but it does not really answer the question and it only really applies to Adobe products. Once you installed your cookie management solution you will need to implement Adobe opt-in to enable/disable specific products based on cookie selection. https://experienceleague.adobe.com/docs/id-service/using/implementation/opt-in-service/optin-overview.html?lang=en
You could always do an implementation yourself to create a cookie banner but you will need to know ePrivacy and GDPR to make sure to give correct group optin/optout functionalities to your users. OneTrust provide this out of the box, BUT it is not the best product and will require quite a lot of coding.