uninstalling Pihole

The code is the command. Copy%paste it to your console.

A more manual way, as it is about APT packages and it’s good to learn how to manage them in general:

apt purge dhcpcd5 dnsutils

It will show you what will be done, also if other dependant packages are removed, and requires you to confirm. To remove then obsolete dependencies:

apt autopurge