I've been fortunate enough to never have to deal with it. The closest I have ever come to it, is figuring out a way to make something I want to happen, happen. Connecting people or events, so forth. When that happens, I do not stress, I just leave it and write another part of the book that flows. It does not matter if that is the end or middle etc. I will just plug it in later. Or if I do not have another part of the story to write,I may stop writing and take a break, but it has never thankfully, been an issue for me.