With this command you can see the installed PHP versions and select the one you want (in case there were more than one installed)
#update-alternatives –config php
Then, to delete PHP 7.4 and all its components, you need to run these commands:
#apt-get purge php7.*
#apt-get autoclean
#apt-get autoremove