Could you provide a bit more detail? How are you operating the yard, is it a hump yard or are you using a shunter and do you mean AI operated engines or are you doing the driving yourself?
If you're driving yourself, you will need to stop the consist before it hits the buffers.
If it's an AI controlled consist, the AI should stop before the consist hits the buffers. Most buffers are set up as signals and as there is no track beyond them, they are always set at danger which will stop the AI driver.
Hope that helps.