I usually figure out how it's going to end somewhere past the halfway point. When I want to figure out my ending, I gather information:
- My characters' values and personalities
- How my characters interact with each other
- My characters' goals
- Good guys win, hands down
- Good guys win, but with great sacrifice (my personal favorite)
- The good guys win, but not what they were hoping for
- The bad guys win, but it's not as much of a victory as they'd hoped
- The bad guys win, but suffer great losses
- The bad guys win, hands down
- **And I always like to throw in: "The planet blows up, killing everyone." It makes me feel better knowing that's an option, even though I haven't used it. Yet.
I'm afraid that's the best advice I can offer from my experience, so I'll leave you with some links. Maybe someone else has a method that works better for you.