Under most riding conditions it's safest to avoid using the front brake when your bike is leaned over. But there are times when trail braking-staying on the brakes while entering a corner-can help you get out of a tricky situation. Ordinarily, in a street scenario, you would brake while the bike is vertical, let off the brakes, and only then arc into a bend. This avoids forcing you to balance braking and turning traction with the front tire, as the two are kept separate and independent. By far the most common situaton where you would be forced to trail brake into a turn occurs when you enter it with too much speed, or the corner tightens up unexpectedly. In either situation, to avoid running out of road you have to scrub off speed in a hurry, while still leaned over.
On a clean, dry road that you are familiar with (or better yet, the racetrack), experiment with leaving the brakes lightly applied as you turn into a corner, and gradually releasing them as you arc in. For a start, use only light braking at moderate lean angles until you have a good feel for how your bike reacts to turning while braking. Be wary of the front end wanting to tuck, which means a lowside is imminent. Maintaining conservative speeds and lean angles, experiment with using more braking force at moderate lean angles, and then more lean angle with light braking force.
As you get comfortable with a variety of combinations of lean angle and braking force, you will find the inverse relationship between the two-in other words, with more lean angle you must use less front brake and vice versa. Ideally, you want to know exactly how much front brake you can apply for a given lean angle, and how far you can lean your bike for a given brake pressure. Once you are familiar with this relationship, concentrate on smoothly releasing the brakes as you lean into a turn, balancing the braking and turning forces so that your bike's front end doesn't dive or lift noticeably during that transition.
For racers, using maximum braking at maximum lean angle is paramount to outbraking your rivals and cutting a good lap time. For street riders, knowing the limits is just as important, but for different reasons. If you know exactly what you and your bike are capable of, you will be better prepared to make that blind turn, or miss that rock in the middle of the road. Another advantage of trail braking is that, because using the front brake steepens a bike's geometry (on bikes with telescopic forks, that is) and puts more weight on the front tire, your bike will steer quicker with a bit of brake applied. Once this skill becomes second nature, you may find that you can alter your bike's setup to take this into account, and benefit in other areas accordingly.