You have to concentrate on something else with all of your might. Think about something that was extremely funny or happy that occurred in your life. Or the easiest way is to start doing some kind of task that requires a lot of thought (like a crossword puzzle).
To forget a bad memory, first you need to stop thinking about it. Get busy with extra curicular activities.
If it is really that bad find a good hypnotist and have them erase these bad memories. It IS possible!
I use to try my best to forget the past, and with the exception of some hypnosis, (if you buy into that kinda stuff), and shock therapy, I think you will always have the past in your mind. Here's the trick: Remember when these thoughts come along that you have come THROUGH these times, You are STRONGER, WISER, and more prepared for the future, and that without the bad times how would you ever realize how good the good times really are. LIFE is a refining fire brought to us via the Good Lord Jesus, and remember HE will never give YOU more than YOU can handle.