After you've written your story, polished it and think it's "ready to go," that is the time to have your work critiqued.
Find at least two, better yet, three people who have experience in the same area of writing, be it picture books for the very young or non-fiction for the most serious adult readers. You might find these people in person or online, through writing groups, word-of-mouth or online searches. They might be other writers (aspiring or published) with whom you can do a manuscript exchange.
Or you can find a former editor or agent or author who does professional critiques. You'll have to pay for these, maybe as little as $30, maybe more than $300. Again, check with friends, writing groups and/or online searches.
Be open to the criticism, but remember that it is feedback and the story is yours. If everyone says your main character is weak, you'll really need to consider that. If you get three widely different opinions, you need to decide which, if any, resonate with you and your story.
It takes courage to ask for criticism, but it will help improve your writing.