1. Set up a clear plan going into the evening. The more consistent routine you have, the easier it's going to be to say good night when it's time. For children of all ages a clear order of events in pictures or a routine book can help to make the expectations clear. Be explicit about the plan ahead of time. "You want two more hugs. So our plan will be two hugs then I'm going downstairs. Does that work for you?"
2. Give the right amount of warning. You want to talk about the routine and your plan but don't dwell on it. If you talk about how you will leave the room when your child gets in their bed through teeth brushing and dressing and a story then anxiety is going to be building for a long time. Before the very last step of your routine say your plan is to ___, then do it and leave the room . When you say you have a plan, give a heads up, then follow through. If your child calls out for you, resist the urge to rehash or renegotiate. The warning might sound like, "Alright it's final kisses, two on each cheek then goodnight." Kisses, goodnight. If your child cries as you leave you might say something assuring like, "You can handle this, I'm near." as you leave the room.
3. Don't get suckered into 'one more'. If your child asks for one more story and you have a little time it's ok to have one more story but when you say your final plan, the plan is final. The more you and your child work together to create that plan, the easier it will be to implement. You might say, "Are there any other things you need before lights out?" You might ask if you child needs water or another hug before you do your final goodnight. Then be explicit about that being the final thing like listed above. If they ask again, you can say, "We are sticking with our plan. You might think of adding that tomorrow. I love you, goodnight."
3. My child calls me back two minutes later. If you leave your child's room only to be called back for one more this or that, try this. The first time your child calls out, go to him or her. You might say, "I heard you calling for me. You're safe in your bed. I know it can be hard to fall asleep sometimes. I'm near if you need me, but I can see you're safe and it's time to sleep. You will need to hold onto all your ideas and stories for morning. I love you goodnight."