Like my bio says, my novel is still in progress so I may never find the “secret to write books.” However, the characters have lived a long time in my mind. How? I’m not sure if I can explain but I can try.
I imagine my characters as real people interacting with each other as real people. As each person does and says things in response to others and the environment, I get a sense of that character’s personality. That is exactly how I get to know people in real life, too. It gets to the point where they are as real to me as the people on the internet whom I have never seen, talked to and heard their voice, nor touched by shaking their hand or hugging. On the internet sometimes one sees a photograph. In my mind I can imagine what my characters look like but personality is much more important to me because what people do and say is what makes the story.
As for describing the details of what a story character is wearing, the colour of a character’s hair or eyes, or the shape or their nose or hands, etc. As a writer I make it up as I go, fitting details with what seems right for each character’s personality, adjusting the story to the details. For example, your character does not see a friend in a red bandana sneak up through the shadows of the woodland if his/her friends are not the type of people who wear red bandanas or if the story is set in a paved-over downtown parking lot surrounded by brick walls and steel posts.
I should add that not every writer works the same way. I develop characters and see where they take me. Some writers develop a situation and find characters to act it out. I can’t speak for them.