There are two kinds of writer's block. The kind that is right at the beginning, often called "blank page syndrome" and the kind that occurs about halfway through the book.
Both are easy to overcome.
Blank Page Syndrome
To overcome the first kind of writer's block... write a shitty book.
Now, stay with me here a second. I swear, this is good advice.
Just write a shitty book.
Think about it, why are you a writer? Because you like to write, you have something to say, and maybe you even have a writer's mission, right? Those are all great! So, would you say that practicing writing would help you achieve those goals?
So write a shitty book. It's practice. By the time the book is done you'll be left with two potential results.
1) A shitty book that with the right amount of editing can now be turned into a good book
2) A shitty book you can put in a folder somewhere to show people of your humble beginnings.
In either case, once you're done with book 1, write book 2 with the skills you've picked up along the way.
Okay, so official writer's block is when you've actually got a pretty decent book going, aaaaaand you get stuck.
9 times out of 10 this is because you've accidentally switched hats. You've gone into editing mode, rather than writing mode.
Writing is like brainstorming. There are no bad ideas, just do it. Listen to what the characters want to do, do that, and figure out how it'll work. Think of it like improv theater or playing a game of dungeons and dragons. Just see what happens. (psst! You can always go back and change something later!)
Write like nobody is watching (nobody generally is)
EDIT like the world is watching.
Optimists made the car, pessimists made the seatbelt. Both have their place. You need to just write and see what happens. You'll spend more time thinking than you will just writing and fixing. So just write.
In conclusion: The solution to writer's block is to start writing, listen to the characters who are in your head, dying to be expressed, and do what they tell you to do - even if it fucks up your plot. They always know best, and no good book's plot survives its character's decisions.