Find Referrals to Exclude
You firstly need to know the domains you will add. Follow the path:
Universal Analytics > Left Menu > Acquisition > All Traffic > Referrals

Once you reach "Referrals", you will see a report like the one above. What you should be looking for here are unnatural referrals, such as: PayPal, Stripe, Myshopify.com, Recharge.com, etc. Note them down and move to the next step.
Note: Social media referrals also shouldn't be here - especially if you are running ads. However, you DO NOT want to exclude them, as they are actual traffic sources. But you want to make a correct UTM set up so that the traffic source is defined correctly, such as paid, campaign name, ad name, etc. Check out this article for the best possible UTM setup.
We will need to set this up for Universal Analytics (UA) and Google Analytics 4 (GA4) separately. Let's start with UA.
Find the Referral Exclusion List
Make sure you are in your UA account. Click "Admin" from left bottom corner (1), and then on the second column, click "Tracking Info" > "Referral Exclusion List".

Add a Referral Exclusion
Click on "Add Referral Exclusion".

Add Domains
Enter the domain you want to exclude (1), then click on "Create" (2). Repeat the process if necessarry.
Important Note: Make sure to add your own domains as well. Referral exclusions work best at the domain level - so don't add subdomains but domains. For example, instead of adding yourstore.myshopify.com - you should add myshopify.com. Add all the domains you have found - and then move to the GA4 setup.

Go to Data Streams
This time, make sure you are on your GA4 account.
Click "Admin" at the bottom-left corner, then click on "Data Streams" on the second column. (If you are not seeing "Data streams" here, you are most probably not on your GA4 account.)

Choose a Data Stream
Click on the data stream you wish to choose.

More Tagging Settings
Choose "More Tagging Settings".

Configure Your Domains
Click on "Configure Your Domains".

Add Condition
Click on "Add Condition".

Add New Condition
Select "Contains" as the match type (1), enter domain (2), click on "Add Condition" (3). Repeat this for all the domains you want to exclude. After you are done, click "Save"(4).
You are done here. Go back to "More Tagging Settings".

List Unwanted Referrals
This time, click on "List unwanted referrals".

Add New Condition
Similar to Step 6, select "Referral domain contains" as the match type (1), enter domains (2), then click on "Add condition" (3). Repeat this for all the referral domains you want to exclude. After you are done, click "Save" (4).
Congrats! You are all done.
