There's some good advice written in Jeremy Silman's book The Amateurs Mind. Also Dan Heisman has a series of YouTube videos on thought process that are generally useful.
Playing longer time controls helps because you have lots of time to find your opponents possible attacks and even if you are surprised there is plenty of time to find the best response to an attack.
How not to panic when your opponent counter attacks? Here is an example of a recent game I played, I dominated the opening and most of the game, however when I launched an attack my opponent counter attacked my Queen. I hadn't seen this coming, so immediately started getting scared that I had blundered the game, I then launched a failed counteroffensive without realising that my Queen had a square to retreat to and everything was okay. This happens to me a lot - basically if something occurs which I hadn't anticipated, my whole body becomes paralysed with fear and I become like a rabbit in headlights. I wondered if anyone had any techniques or tips on how to conquer this?