Write a story about a person who can see ghosts, but only when they're wearing a certain hat.
Once upon a time, there was a young man named Max. Max was like any other person, except for one unique ability - he could see ghosts. However, this ability only manifested when he was wearing a special hat that was passed down to him from his grandfather. The hat was old and worn, but it held immense power.

Max had always been fascinated by the supernatural, so when he discovered he had the ability to see ghosts, he was thrilled. He would often spend hours exploring abandoned buildings and cemeteries, searching for spirits that he could communicate with. However, this hobby soon became a burden, as the ghosts he encountered were often angry and vengeful, seeking revenge for the wrongs they had suffered in life.

One day, Max stumbled upon an old book that described the history of his hat. According to the book, the hat had been created by a powerful wizard who was able to capture the spirits of the dead and control their actions. The wizard had used the hat to gain immense power, but eventually, the spirits revolted and the wizard was consumed by his own creation. The hat was then passed down from generation to generation, each owner gaining the ability to see ghosts but also facing the dangers that came with it.

Max realized that the ghosts he encountered were not random spirits, but were being controlled by the hat. The more he learned about the hat's history, the more afraid he became of its power. Despite this, he couldn't bring himself to part with it, as it was the only way for him to see his beloved grandmother who had passed away when he was young.

One night, Max was confronted by a powerful spirit that demanded he return the hat. The spirit revealed that it was the wizard who had created the hat, and that it was seeking to reclaim its power. Max refused, and the spirit began to attack him, causing Max to run for his life.

Max eventually stumbled upon an old sage who lived in the forest. The sage told Max of a way to break the curse of the hat and set the spirits free. Max was skeptical, but desperate for a solution, so he followed the sage's instructions.

The process was long and dangerous, but eventually, Max was successful. The hat was destroyed, and the spirits were finally at peace. Max was no longer able to see ghosts, but he was relieved to be free of the burden and danger that came with the hat's power.

From that day on, Max lived a quiet life, surrounded by the memories of his experiences with the supernatural. He never forgot the lessons he had learned, and he always remembered the power that can come with a simple object like a hat.