So I'm currently trying to write a book but the problem I keep having is that I lose motivation because I have a lack of self-confidence and keep thinking things like, "No one's going to like this." "People will misunderstand what I'm saying." and things like that.
I'm well aware of all the difficulties involved with writing and publishing a book, that's my problem, my request for advice is how I can be more confident in myself and be reminded of the good things that could come from this.
Write a lot of short stories, or other short form works. When and if those stories start meeting significant acclaim, THEN write a book with the earned confidence.
'Cause, y'know, odds are very good that you're absolutely right about people "misunderstanding" and not liking your book.
I'd say try to not worry about whether the book might be successful or not. If you go in with the aim of making money off it there is always a chance it'll fail and that will ruin your morale. Just write it because you want to write a book. When you finish, if you are happy with it, show some friends or family. Take constructive criticism on board and try to improve it further. If someone you trust assures you it is good then look at getting it published.
Most authors write a lot of crap before they start writing good stuff. Accept the fact that you'll write a lot of crap and dive right into to writing crap you wish was better.
It's like anything else. Want to be good at shooting free throws? Be prepared to miss a lot first.
There's a few good books out there on writing. Stephen King's On Writing is good - the first half is autobiographical about becoming a writer, the second half is actual advice. I also like Peter Elbow's Writing With Power, which has a lot of good advice. If you was to write formulaic television plots, check out Save the Cat! by Blake Snyder. It's also good for seeing what cliches to avoid.
But mainly, this:
If no one likes it and people misunderstand what you had to say, you will still have written a goddamn book, which is something an awful lot of would-be writers cannot say.
You're probably not going to be the next JK Rowling. You may get published, if you have a strong voice that other people want to listen to and/or you're willing to get and heed feedback to hone your work into something that does get the message you want through and does make other people want to read it.
But, ultimately, you've got to do something like this not for the external rewards, but for what it means to you.