How Do I Know When To Use Irr Instead Of Npv To Compare Investments?

I understand IRR returns a percentage and NPV returns a value, but aren’t they both just as good for comparison?
I am confused on when to use each of them?