High happily and highlove, Another veteran here not out the other side, yet. Been TTC for 2,5 years, got my only BFP after IUI and SO in August, but miscarried in September and just got back on the horse. It hurts, it is shit and I've found Christmas this year the worst yet (partly because of the diffed friends with due dates on either side what could have been bringing the grief back to the fore). We're also unexplained and I find that very frustrating. Since having treatment I've noticed that DH's contribution varies a fair bit, so I've adjusted our diagnosis in my head to mild male factor, don't tell him that though 
I wanted to answer with recognition, and drop some home made mincepies for you two, but I also wanted to give some response to the question you posed in this thread. I don't think you can stop TTC affecting you, but I've found a number of things have helped me cope.
First, I completely lost it at about 2 years of TTC and found some counselling - I cancelled it when I was diffed, but started it properly after MC. It has helped me a lot.
A few of the things which I think made the load lighter for me were: accepting that it is shit, that you can and should take the time to mourn for not getting pregnant the normal way, hating the intrusiveness of fertility treatment, and doing it regardless. That is a big thing we do. I found it helpful (if very difficult) to express why I am doing it (in my case I have a very clear image of the moments after birth, when I am holding our own new-born, that is my goal).
The other thing I realised that if you feel miserable about it, that is normal. You should not beat yourself up about it. Instead you should be nice to yourself. In practical terms, this means initially I tried to get to the hair dressers or beautician vaguely regularly, but since then I got a lovely busy job, so I just decided to make a treat-my-self parcel for Christmas as well (with Dvds, wool, nice shower gel etc).
I write a diary now, and consciously try to see how I feel, and whether I am bottling any stresses, hopes, fears and despairs re: TTC up. Admittedly, I failed the last few days, but it has helped me spot patterns and also bring up things with DH, for instance when I need a bit more support.
Finally, I feel a lot better when I am active. So I joined a running group and a rowing club this autumn (just after the MC). I spend time with the people nearest and dearest. Even if they have children. We spoil my nephews rotten. But when I am having an off-day, I'll avoid people. We did not go to my ILs over Christmas, as there have been issues on and off over the years, and I just didn't want the stress.
Hope this helps a little... Take what can aid you, ignore the rest. Good luck with treatment!!