There is no single VPN product and thus there is no single configuration. Therefore only general recommendations can be given, how they are applied to your specific VPN setup you must see yourself.
UDP vs. TCP does not really matter regarding anonymity. What matters is making sure that actually all internet facing traffic is sent through the VPN, i.e. not only IPv4 but also IPv6. Also all DNS traffic should go through the VPN and you should not use your ISP provided DNS server. Search for "IPv6 leak VPN" and "DNS leak VPN" to get more information about this and also to find leak testers. Also make sure that you don't leak any traffic in case the VPN crashes, look for "VPN kill switch".
Of course you need to be sure that the VPN provider itself can be trusted, because it is basically your gateway to the internet and can see all your traffic, and also modify or block it (but not break encryption in HTTPS etc). If you self-host your VPN exit this also means to trust your hosting provider, since all your traffic now goes through this provider.
Similar you need to also be sure that you trust the DNS provider too, because it sees all the domains you lookup, which are very likely the domains you visit. You might choose to run your own DNS resolver on an external host, but like with running your own VPN exit the hosting provider then can see all the traffic.
And don't have the illusion, that securing VPN and DNS is all you need for anonymity. The VPN does not protect against any tracking done inside the browser, i.e. tracking done by the websites you visit, tracking by ad and tracking networks including in the majority of websites, tracking by social media networks etc. Information you leave on websites, like when participating in discussions, also leave a trail which can be used to de-anonymize you.
All a VPN does in terms of anonymity is hide from your local ISP what you are doing and hide your ISP given IP address from the sites you visit. But the information what you are doing is still there - only this time to the VPN provider and not the ISP. And it is not much effort for websites to find out that you are using a VPN and some might block access because of this, like access to content which is licensed only to specific geographic location.