Using existing story in your book
Very important topic to understand and to be aware of for every book author or other work creator is whether you can or can not be inspired by books of other authors when creating yours. If yes, in what extent?
From the law perspective, in most countries, the copyright itself does not protect idea itself but the exact expression of this idea. That means someone writes a book which main topic is about young man who can transform himself into crocodile and thus becoming superhero, that does not mean none else can now write book about superhero who is able to transform into crocodile.
The thing you can not surely do is copying the whole work or its substantial part unless you obtain its author permission. But you can use idea itself in your own original work.
What does it mean to have original work in this case?
It means that even though you use the idea of superhero being able to transform into crocodile in your book, you need to put your own effort, skills and other ideas to create something new, something distinct from work which inspired you, to have your work copyrighted and to not infringe the previous work.
Where is the border between originality and copyright infringement?
This is the question that can not be generaly answered but it is individualy answered in every single case. Once the copyright dispute arises, the court needs to consider all the elements, circumstances and expressed ideas of work in order to decide the case.
Conclusion
The fact is that none wants to read copied work of someone else. The goal of every book author should be to create something new and original. Every author wants to be distinctive and only dishonest person would like to parasyte on someone else book. However such cases happens and in such case it can be hard for copyright holder to protect his work though he is just protecting his own creation. This is caused by the The subjective nature of the assessment of each case as there is no single answer where is the border between honest inspiration and copyright infringment.
If you want to use someone else book as your inspiration, you can do it, but create your own work, create your story, put your effort and ideas into it, and then you are safe to continue.