First, I'm sure you've already considered this, but for future visitors: don't get into this situation. If you're at all unsure of your brakes, stop riding until you can get them fixed. Brakes don't just stop working for no reason. Most cyclists should never experience this.
Second, are you sure you have to stop right now? If you're on the flat, you can come to a gentle halt just by sitting up in the saddle (to make yourself less aerodynamic) and waiting a minute. This is certainly preferable except in an emergency. If it really is an emergency, and you must stop in the next few seconds to avoid a brick wall, cliff edge, boiling lava, &c., do the following:
Manoeuvre to somewhere it is safe to do so, and then put your weight on one side so that you fall over sideways. You need an empty space a few metres long (depending on surface conditions and speed) to be sure you won't hit anything. If you're on a road, hitting a high kerb at an angle should help you land on the footpath. If you're in parkland or countryside, a hedge or bush is a much better option than a drainage ditch.
Be careful that even though you know a fall is coming you don't tense up: keep your joints loose and tucked in. Even at a fast cycling speed, if you stay frosty and alert you should be able to walk away from a deliberate fall like this with some bruises, no broken bones or head injuries.