We all have our things we do not like, and avoiding it will not help you, or get your credentials. If it is really distressing, take breaks at times, and recollect your mind. Maybe do an activity like taking a walk or watching a movie. It depends. But you also need to realize you are doing it for your class, so you also have that motivation to get it done. And that is how I would cope too. See things through to when you finish the assignment, and clearing your mind and taking s break if I am distressed.