*Is the GM Rex mentioned*
Everyone here has hit a lot of solid points. I'll add some more that I think are important.
Wizard (and Rex) hit the nail on the head for one of the reasons most GMs fail, and that's that a lot of rps here start up from initial excitement to an idea but that excitement trails off and very few of them are actually thought out and properly planned. Knowing where you're going and what you're doing is important - although naturally having every storybeat in mind from the outset isn't fantastic as it stifles player contribution, but having stuff in mind planned storywise that you yourself want to see is a good self-motivator, and it just helps keep the rp focused too. I feel players can sense when a GM doesn't know what he's doing or if the rp's heading in a general direction, and that'll eventually show negatively.
But that's not all. People who choose to be GMs should also think and plan beyond just story beats and figure out how and in what way the rp is being run and why. For example, I structured my rp in such a way that it was divided into chapters and that each chapter had a different theme or setting, which helped maintain my interest in the rp because I get to write for different situations rather then be stuck pidgeon holed into one genre, which I feel is something that can eventually help lower interest. Other things such as plotting co-gm chapters where I work with my players to share their own ideas, take the lead and for me to step back a bit. It's also rewarding to help guide my players to hopefully gain the confidence to become GMs later too, perhaps. For the GM I'm currently GMing (which has been running for over a year now) after a failed first try I waited a year before restarting it and planned and considered lots of ideas for both the story and how I'd run it as well as gauge my interest in it before starting.
Communication is the other key factor, and this helps to improve player's interest in an rp too. Honestly, compared to anything and everything else, communication is the main biggie. As has been suggested, talking to people and making friends is incredibly important. I don't just run my rp now because I want to see my rp's story develop, I do it because I want to hang out with my friends and have fun with them. They are my inspiration. Ialso like to incorporate their interests into the rp and see how they react to things I do in the rp (especially an upcoming plot twist I've been waiting two years so far to reach... |3c). It's a nice feeling. I come onto the site everyday to see their wonderful writing, develop the story we're developing and talk about anything and everything, be it music, video games, films etc.
And honestly it's very, very flattering to have Rex say everything she has from watching the way I GM. That makes me happy (and is good motivation to keep on GMing! |D Thank you Rex).
Saying all that though, at the end of the day whilst suggestions and advice can be given its ultimately down to the individual and self motivation. GMing takes a lot of time and responsibility and it's something people who wish to be prospective GMs should really consider and think about before they start an rp. For the most part the time it'd take to do an rp and its story justice should be relatively long I think, given the nature of the medium (and say how some posts for interaction between players could amount to like a minute, and if that's one post a day or later then yeah, story's gonna last a while and rp take a lot of time). I'd personally love to see people who try to GM an rp do so for at least three months before bailing, the latter being all too common far too quickly. Players dropping out is always an occurence and something that is annoying, but a GM bailing out is even worse and a major motivation killer, since they're meant to be the leader and guide of an rp whom players put their trust in, and if it happens often enough it can breed distrust in expecting any rp to last long. And if you're an rper making a character and want to join an rp and become invested in that rp's story and world, then... yeah.
A Co-GM or several is helpful for those who might struggle singularly, since they'd be there to help inspire everyone to keep going through the sharing of ideas etc, and it helps take the weight of responsibility off a person's shoulders too and share it out. And, in contrast to what I said earlier about GMing for at least three months (something I feel prospective GMs should aspire to) if someone really does not feel the motivation to continue being the GM, then they stop immediately, because feeling like that doesn't benefit the rp and will instead cause future problems for themselves and their players. If such a problem is occuring then talk with the players, let them know. Maybe inspiration will strike and things will work out so you can carry on, or maybe the interest is gone, in which case another player could take it up (if they so feel it) or they can know to look elsewhere. Having the feeling like you're on a sinking ship but not knowing for certain is really not fun whatsoever, and players' free time should not, I think, be used on an rp that's probably not going anywhere.
Best of luck!