If I had to give one piece of advice to someone starting to write a book, I would first of all say: make a good plan.
Writing inspired by the moment gives a lot of pleasure. I would prefer to write that way myself, but you quickly fall into many writing traps – especially with fiction.
To give one anecdote of my own. I wrote my first novel, Kalius, practically without a plan. I had a story in my head, but nothing very concrete. And somewhere in the middle of the novel I kill some poor guy, and then this same guy, perfectly healthy and guiltless, appeared a few chapters later and lived happily through the next chapters. Fortunately, I found this out before the book was published, but it took me weeks to correct the mistake. I had to change all the texts where the unintentional zombie appeared. With a good plan, you can avoid such things.
I work a bit like this: first I come up with an idea for the story, what I actually want to say with it. Even if it’s a fantasy, I want to say something to the reader. Then I go from chapter to chapter and make a plan of what is going to happen in a particular chapter. In Excel, I identify the main characters (even the side characters if I already have them in my head) and give them characteristics – character, physical characteristics. You won’t believe how much time you can waste going through pages looking for a person’s eye colour – for example.