This is similar to What is a good policy for dealing with parents who leave their children at the library as free daycare / babysitting?, but I did not see an answer to this question in any of the policies.
This is one of my least favorite parts of library work! (Misbehaving adults is probably the worst.)
We have a posted Code of Conduct in our library which we can print out and hand to people if necessary. If a child's behavior is breaching that code, and the child is old enough to understand, we speak directly to the child, and try to move them from negative behavior toward more positive behavior: "We're glad you are having fun at the library, but throwing things can damage them and hurt other people. I see you are wearing pink. Did you know we have a book all about pink things? Let's go see if it is on the shelf."
If the child is too young, out of control, or not responding to our intervention, we speak to the parent: "Excuse me. Throwing things is not allowed in the library. If your daughter won't stop, it would probably be best if you came back another day when she is more settled. Can I help you get those items checked out?"
If the parent/child remains unresponsive, you may have to insist they leave. "This behavior is in breach of our rules. You'll need to leave now, but I hope you will come back another day and try again." Then hand them the policy, and help them leave.