Writers, in fact anyone, should avoid creating art to please others. Instead, write about (altruist) content that you find engaging, which may inspire others. And in the process, you'll avoid ennui and depression, but you'll gain self-control.
Patricia Highsmith, the author of The Talented Mr. Ripley, reportedly advised:
The first person you should think of pleasing, in writing a book, is yourself. If you can amuse yourself for the length of time it takes to write a book, the publishers and the readers can and will come later.