You can go through the below link - https://doc.sitecore.com/xp/en/developers/sxa/93/sitecore-experience-accelerator/add-a-cookie-warning-message-to-your-site.html
If you want to be compliant with General Data Protection Regulation (GDPR) and ePrivacy, you must inform your users about collection and sharing of personal information. SXA lets you inform visitors that your site uses cookies. You can customize the message, select the warning type, and exclude pages from having cookie warnings.
To add a cookie warning to your pages:
In the Content Editor, navigate to sitecore/Content/<tenant>/<site>/Settings/Privacy Warning
.
In the Privacy Warning Content section, fill in the following fields:
