My best advice I got from other writers: READ! That’s what I did when I started writing. Read some of your favorite books to get the gist of the different writing styles. You can even take some writing courses to help you get some practice.
Another great advice is to keep a special journal with you to store ideas that may pop in your head. That way, in case you get a writer's block, you'll have your journal in handy to help get back on track.
If you become inspired to write from a book, then go for it! But remember: writing a “successful” book (fiction or nonfiction) is not always easy, and it can be time-consuming. Along the way you may run into some writer’s blocks, learn new things, let things go, or decide to make some changes, like I have. But if you keep writing and never give up, you may find out that it will all be worth the hard work!