Need some helps with the tactics in the middle game I sometimes find it very difficult to determine the accurate moves in middle game. When a tough opponent is in front of me I dont let to attack at first. I strengthen my defense. But if I ever try to attack, the opponent destroys my defense and I fail! Sometimes I feel this is the right move and also understand the consequence of the move! But still there remain quirks on my move and the opponent take the advantage! I even find it difficult to calculate moves as there are so many possibilities for an opponent!  So i want to know how to determine the accurate moves as the grandmasters do and also how many moves should I calculate before any move?


[White "NN"]
[Black "user4226"]
[StartFlipped "1"]
     [FEN ""]

1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. d3 Bc5 5. a3 d6 6. b4 Bb6 7. Bxc6+ bxc6 8. h3 O-O 9. Bb2 a5 10. O-O Be6 11. Nbd2 Nh5 12. Nxe5 dxe5 13. Qxh5 f6 14. Rad1 axb4 15. axb4 Ra2 16. Rb1 Bd4 17. Bxd4 Qxd4 18. Rfc1 Rb2 19. Rxb2 Qxb2 20. Qd1 Qxb4 21. Rb1 Qe7 22. Rb7 Qd7 23. Nb3 Bxb3 24. Rxb3 f5 25. exf5 Qxf5 26. f3 Rd8
Chess is a skill that requires hard work and dedicated toning, just like learning to play a musical instrument. Unless you are very exceptional, you won't become a master at it within a few weeks, months or years (the good news is that you don't have to be a master to have fun with chess). Some players were lucky enough to be very talented, had the opportunity to start young and maintained an almost obsessive interest in it - they are the ones most likely to become IM's or GM's after 10 to 15 year of dedication. Most of us just play for fun and must maintain a realistic perspective.

I suggest you read Willy Hendriks' book "Move First, Think Later". The book addresses the very essence of your question, which is: How do I improve my chess?

As a warning, the book is controversial, especially since it spends a lot of effort in undermining certain common conceptions about chess improvement. Hendriks is not scared of taking on the establishment of chess training.

From memory, here is a list of things he suggests you focus on:


Tactical puzzles. Nothing improves your chess quicker than doing a lot (as in thousands) of puzzles, as it "programs" your brain to spot good moves and continuations.
Play a lot. Over the board, on the internet, as much as you have an appetite for.
Notate and study your games. Try to understand where you went wrong (I, for example, found I have a weakness in spotting tactics on my king behind the pawn line).
Focus on the things that motivate you. For example, here on chess.SE you will often see the advice "don't study opening theory at beginner level". Well, if you like studying opening theory, then studying opening theory is perfectly fine.


Here is a list of things he suggests you don't waste your time on:


Worrying about general rules and common adages (for example "the bishop pair", "respond to an attack on the flank with an attack in the center", leave your thinking time for the "critical moment")
Approaching chess from some ideological/academic angle (like Silman's "imbalances"). Hendriks argues that chess ability is not a rational skill, and a rational-based approach will not help in improving it greatly (this point probably needs some elaboration - he's not saying chess is irrational, but that taking some kind of reasoned approach won't help you much - you are going to be better off with an intuition toned through practice than over-the-board reasoning). 
Worrying about developing some kind of structured thought process (for example: 1. Consider threats. 2. Consider attack points. 3. Consider tactical motifs. 4. Consider alternatives etc etc). Hendriks argues from findings in neuroscience that your brain functions heavily in parallel - don't try to serialize your thinking by adopting a thought process that sub-divides goals - instead, let your brain do its work naturally. Just find the good move!
Trying to calculate every position 10 moves deep. GM's don't generally calculate that deep (unless the tactical situation calls for it, of course).
Following some abstract "plan". Rather, focus on finding good squares for you pieces and making good moves that forces your opponent to counter actively.
Spending 10,000 hours doing it even if you hate it.