First I'll give my advice and then explain by talking about my experience learning the guitar. My advice for the absolute beginner is to above all else HAVE FUN PLAYING GUITAR! Nothing motivates a person more than passion. And as you improve you can increase your dedication/discipline with the instrument. My advice for the intermediate and advanced players who want to stay motivated is to practice a little bit every day, even if it's just 10-15 minutes. Remind yourself before you say no to practicing that you can take a lesson on this website in five minutes. Just give yourself five minutes a day to listen to Papa. And then after you practice for another 10 minutes either take a break or keep playing for fun. Whether that means playing songs you already know, making up stuff to a backing track, writing original material... Whatever your definition of fun is really, whatever you play the guitar for, make that the majority of what you are doing with the instrument.
I remember in my formative years that I would feel very frustrated and angry when I couldn't play the guitar at the level I wanted to. However I was essentially addicted to playing guitar. I couldn't help but play even when it was upsetting in some ways. I really enjoyed it too much to quit out of frustration. And eventually it just started sounding better. The key word there is "started." Because eventually you realize you need to refine your techniques. Because of course you are never done learning the guitar(or anything worth while). You will never know it all. The best guitar players, hockey players, or any other kind of professional will have the mindset that they can learn something new any given day(whether it happens or not).
Early on, I just decided to have fun with guitar. It was always there for me. And I never really pushed myself to work hard at it. Of course I can play for hours at a time. But it is hours spent having fun. It doesn't feel like practice to me. This was great for me early on because I might have quit if I didn't enjoy it enough. But this approach does have a downside. It doesn't teach the formally educational part of the instrument. However I am now more than ever making a push to get better at sight reading and music theory. And a big part of that is actually because of this website which I am very grateful for. Honestly it is such a great resource. But I do have some theory books I picked up recently, which also help. It's a challenge, but it is a challenge I look forward to each day.