Is it trim along the floor or around a door or window? I would say to remove the entire piece of trim, take it to your local lumber yard to see if you can find a match, and replace it with new. This means staining and using poly. Hopefully you have some matching stain. You could use the old piece to find the right stain color if you don't have any matching.
I think Gk has given some good advice. I'll add this, though: if just a small piece of your trim has broken off, you might be able to use wood glue to reattach it to the rest of the trim, assuming your trim is made of wood, of course. Then sand down the seam and repaint or stain to match.
My question about the trim is on a solid wood desk. Most of the molding is on it, but a small section is missing. How do you fix that?
Hello again Brenda! Do you have the piece of trim that broke off? If so--some wood glue will work to reattach it. If you don't have the broken piece you will have to make some different decisions about what you can do. If you can post a picture so we can see your desk we might be able to give you some better solutions.