By Aditya Shukla - creator of the brain-based guitar method
Sense of timing is related to repetitive body movements. Use your body to keep track, practice tapping your foot or moving your neck to a metronome.
Complex riffs need to be broken down into chunks that feel easy. Get the groove for those and then combine.
Forget the riff, first hum and sing the riff correctly on time. The brain adjusts timing through voice better.
If you can practice a shape on a lower tuning, do it. The brain understands time better at lower sound frequencies.
Your brain has to trust muscle memory to correct its errors naturally. Make adjustments without looking at the fretboard.
Each syllable Bo No Bo Bo is a note. Sing your rhythm as syllables first. Change the pacing of the words to match the beat.
If a metronome is stressful, use a -1 track, drum loop, or programmed drums. The brain likes context. Metronomes don't give context.