Acknowledging that you are experiencing a mental block is the first step in dealing with the problem. In this step, it is crucial that you look for the actual reasons which are the source of your mental block. Most of the time, it occurs in the form of performance anxiety due to the onslaught of a certain event which triggers our 'fight or flight' response. Or, it may be because of the fear of failure. Whatever the cause, it is essential that we diagnose it and try to nip it in the bud.
Try Something Different for a Change
Do a different activity that you are good at. Be it playing scrabble all by yourself or shooting hoops at a basketball court. The idea is to achieve a sense of fulfillment that helps you in relaxing. Don't do something that frustrates you, it will only aggravate the matter. Anything that breaks the mundane routine of your work can be effective in broadening your vision and in seeing new answers to a problem.
Take a Shower
Mental blocks are mostly the result of anxiety about the future, and act as deviants from being steady in the present. Taking a shower helps relax, as it focuses your attention towards the present moment. Then, with a steady mind, it's more easy to tackle a problem which is firmly rooted in the present.
Play to Your Strengths
Handle smaller or manageable tasks first. For example, you undertook a project which consists of parts that you don't understand. Leave them aside for the moment, and try dealing with the concepts that you are clear with. You may start understanding the parts of the project which were unclear to you while completing the other clearer parts.
If you thought across your problem through all angles, and are still unable to achieve any breakthrough, talk to other people about it. Maybe they can introduce you to a new perspective which you couldn't come up with. Or, you could even search the web for how people, when faced with the same problem as yours, managed it.
Don't Beat Yourself Up
It's imperative that you keep a positive attitude at all times. Read 'self-affirming' quotes out loud to yourself, like 'you can do it', 'day by day in every way, I am getting better and better', etc. Keep a poster of an inspirational or positive quote that you like near your workplace or in your room. Grasp its meaning and adhere to it religiously. And lastly, be kind to yourself.