Instruction collected from multiple sources, there may be unnecessary steps, but that what worked with me after 4 days of stuggling :), so I'm recording it all
Install Xdebug 2.9.8
using pecl
sudo apt -y install php7.4-dev php-pear
pecl install xdebug-2.9.8
Create xdebug.ini file in mods-available