Usually I refrain from the source that make myself stress, Then switch to do something else until I am in state that can handle it.
I find myself handle stress poorly if I handle it too quick or with emotional, my best advice is learn to give things up and remember everyone can make mistake.
In the morning I usually do a simple 20-40m workout that includes running, and some power exercises with weights. This helps me sit and do my remote work without self-interrupting by viewing vids or playing games. In the evening I just boil two liters of tea and continue to work in front of my laptop for self-education. It's a funny thing - learning a Linux posix and bash prompting!