This can be daunting. I tend to develop mine loosely and let their reactions to the plot define them further. Some people choose to develop them fully before they even begin to write. Both ways work fine. Some write the plot and develop characters as they come across them. This can work too.
However you choose to do it, the key to amazing characters is to remember they are not you, nor are they hero or heroine you wrote about before. Each one is different. Each one is their own complete person. Put yourself in their shoes and they will react naturally to situations. When you write a villain, be one. When you write a hero, be that hero. The characters will become three dimensional.
A trap a lot of writer’s fall in is making each hero, heroine or villain too much like the prior ones they wrote. This can turn off a reader to point where they stop reading you.
If you have trouble with this, try giving them some 2 or 3 things different–physical characteristics should be more than just superficial coloring changes, like walking with a limp, arthritis, allergies are fine as is a lisp or talking with an accent. Perhaps one has a lazy streak, or a knitting habit, or is a dog lover. The possibilities are endless and your character now has depth. Remember to change the differences each story, or you are back where you started from.
Use the differences to move a plot along too. For example: my current WIP features an artist in therapy. It is suggested she take up gardening. Being an artist she decides to beautify her planters and makes a trip to the local hardware store for supplies. There she will meet her hero.