When a pepper plant has flowers but no peppers it is because of a lack of fertilization. There is an easy solution to help the pepper plant make fruit.
First a little science background: Pepper plants are self-pollinating. A pepper flower already has both parts needed for fertilization, the pollen and the ovules. When the pollen gets to the ovules that is fertilization and the pepper plant will begin producing fruit.
The pollen producing part of the flower are the anthers and they sit on top of slender filaments. The ovule or egg producing part of the flower is further down inside the flower. It has a long filament that extends out of the flower with a stigma at the top. The stigma can be seen surrounded by the anthers in the picture below. When pollen gets on the stigma it travels down the long filament to the ovule and completes the fertilization process.
How to successfully pollinate.
In nature the wind and bees help the pepper plant to move the pollen inside the flower and get it on the stigma. Now it is going to be up to you to be the pollinator!
Step one, be the wind.
Gently shake your pepper plant early in the morning. This allows the pollen to fall from the anther and move around inside the flower. When pollen lands on the stigma fertilization has occurred.
Step two, be the bee.
Bees are professional pollinators and so this second method is more reliable. Touch the pollen on the anthers with a cotton swab or the tip of your finger and get it covered in pollen. Rub the swab onto the stigma that is sticking out above the anthers. Moving the pollen from the anthers to stigma accomplishes fertilization. Now, with the same swab, move on to all the flowers by getting more pollen on the swab and putting it on the stigmas.
These steps can be performed in the morning throughout the flowering cycle to ensure proper fertilization.
One thing to keep in mind regarding pepper pollination:
If it's very hot or cold, pollination may not occur. Pollination and pepper fruit set is not as likely to occur when daytime temperatures rise above 85˚ F or when nighttime temperatures drop below 60˚ F.