Writing is work. It's frustrating. When it's not going well it's downright painful. But sometimes it does go well. And at those times it is exhilarating.
One trick to developing a good relationship with your writing is to focus on your memories of those moments of exhilaration. Don't let those memories slip away and start thinking that the writing process is nothing but anguish.
It's so easy for us to do--to gloss over the full complexity of our experience to focus on one particular aspect. Of course, if we always gloss over the problems to focus on the good things, that's one situation that presents some problems--but it's not a point of view that tends to negative emotion, and to that extent, at least, it helps generate a positive attitude.
The problem--certainly a problem faced by many writers--is a focus on the weaknesses, such that both the good aspects get lost, and negative attitude and emotion inhibit further work on the project.
Ideally we can see the problems that exist, and the opportunities. We can see how each problem presents opportunity, and how each opportunity presents problems. While seeing the situation clearly, we also keep our focus on the positive outcome we're trying to create, and on the positive experiences we have had through similar efforts. Keeping focus on the positive, helps keep energy up; who doesn't get more tired when discouraged and energized when encouraged?
Keep your mind on the good feeling--on those moments when writing was going well--and you'll be able to change your relationship with your work.