Distortion changes the guitar’s dynamic response and can make subtle string noise more obvious. Checking a passage with both clean and distorted sounds gives you different things to listen for.
I personally find it useful to start with a clean sound. I practise the riff until it sounds clear, then check it again with distortion. At that point I listen for strings ringing when they should be muted.
Try the same passage with both sounds
Choose a short riff you already know. Play it clean and listen to whether each intended note sounds clearly. Then try it with the amount of distortion you plan to use in the song. Adjust the output level so the comparison stays at a comfortable listening volume.
Listen for unwanted ringing, especially from strings you did not mean to play. Pause at the troublesome note and work out which hand can mute the unused string without cutting off the note you want.
You can use the same comparison when practising hammer-ons and pull-offs. Listen to the strength and timing of each note, then work on a short section that needs attention. Switching sounds helps you hear a problem; you still need to work on the movement that produces it.
If the notes are clear but the rhythm drifts, try practising with a metronome. The beginner lessons give you a route through the other basic skills.