Often the best investing opportunities are to be found when others are panicking—and that's the case now with municipal bonds, or munis for short. Muni bonds are debt taken out by municipalities like cities, counties and states to fund projects to benefit their residents. Usually the taxes collected or the revenues generated by the project are used to pay the interest and principal to the holders of the bonds.

In the wake of Detroit's bankruptcy filing two months ago, many investors are overreacting by avoiding the asset class altogether. Their logic is that Detroit's filing—the biggest ever for a U.S. city—means any other municipality could do the same.

And that means there are opportunities out there in the form of high yields. It's critical to be very selective, however. I recommend munis that mature in 10 years or less, and that are insured. Two recent issues worth a good look came from Puerto Rico.

The commonwealth has a heavy debt load, a weak economy and persistent budget deficits, and it's had to pay up in order to borrow money. As a result, 10-year, insured bonds from the Puerto Rico Electric Power Authority are yielding 7.25%. And six-year, insured general obligation bonds are yielding 6.9%.

Compare that with a 10-year Treasury, which is yielding about 3%. In fact, good yield is so scarce these days that insured munis may make sense even for low- or moderate-tax clients.

There are caveats with any investment. One of the main ones in the muni world is how high interest rates will rise; rising rates tend to drive bond prices down. An investor can defend themselves against these rising rates by buying high-coupon bonds with good current yield, buying shorter maturities, and being selective with credit quality.

Still, it's remarkable that bonds with 7% tax-free yield are available with insurance. Having insured muni bonds is kind of like having a co-signer on a loan that you make. It makes it that much more likely that you'll be repaid.

Of course, you have to be confident that the co-signer will stick around and continue to have the ability to pay up in the event of default. In the case of municipal debt, you want to make sure it's backed by a strong insurer rather than one of the weaker players.

In the event of a default, the insurer's role is to take over interest payments and then repay principal when the paper matures. The insurers are private companies, not backed by the government, and there is never a guarantee that a company won't fail. But choosing bonds carefully and knowing they're backed by a healthy insurer should help you sleep well while earning income at a good clip.