It sounds like you're caught in an overly self-conscious cycle. You aren't running well, so you're putting more pressure on yourself, so you don't run well, so you put more pressure on yourself.
A change of scenery may do you some good. If you train with a group, you might want to do some running by yourself for awhile. Give yourself some time to just enjoy running again. Remove any pressures you or others are placing on yourself. Don't do anything to test yourself for awhile until you've had time to build your confidence back up.
On the flip side, you may be wearing yourself out in some other aspect of your life. If you've got too much on your plate, you may be mentally and physically tired when it comes time to race. It may also change your motivations, making running just another thing that you do, rather than something that you enjoy and care about doing well.
Don't beat yourself up about it. That's the worst thing you can do. This happens to everybody some time and will go away if you just let it.