If maintaining a solid rhythm is your issue, I highly highly recommend the technique linked below.
I recently started playing electric guitar again, and am revisiting lead riffs that I couldn’t play properly the last time I tried them… over a decade ago.
Without exception, I find that if I am still struggling, standing up and walking/marching in place almost immediately reveals where the problem is, and starts me on the path to fixing it.