The usual advice for would-be writers is to read, read and read. That way you can see what published authors are doing and get a sense of what the market wants.
More than that, though, you can see how authors do it by analysing their use of writing style, characters, beginnings and endings, grammar and so much more.
This doesn't mean you have to copy them, but you can certainly emulate the way they put a story together. And the secret here is to critique a book rather than being a critic. By that I mean you can analyse the strengths of a book and the weaknesses, and learn from them.
The New Author Profile this month is Ayisha Malik, whose debut 'Sofia Khan is not obliged' came out in January via Bonnier imprint Twenty7Books.
Described as 'a heartwarming romantic comedy', the theme of the book is about a London-based hijabi (a woman who wears the Islamic head-covering or scarf), who has sworn off dating men... then is asked by her boss to write a Muslim dating book.