Ash could learn about Spiritomb's past. By understanding what Spiritomb has been through, such as how it was trapped in an old ruin for a long time before being released, Ash can have more empathy. He can then try to help Spiritomb overcome its fears from the past. For example, if Spiritomb was once captured by a cruel trainer, Ash can show it that not all trainers are like that. This understanding and Ash's efforts to heal Spiritomb's emotional wounds will lead to a very deep and meaningful relationship between them.
To develop their relationship, they could share experiences. Maybe Ash takes Spiritomb to a Pokémon festival. At the festival, Spiritomb sees all the different Pokémon having fun and being friendly with each other. This makes Spiritomb feel more accepted. Ash also introduces Spiritomb to his other Pokémon friends. His Pokémon show Spiritomb how they train and play together. Through these shared experiences, Spiritomb becomes more open and friendly towards Ash, and Ash sees Spiritomb in a new light.
The relationship could start with Ash showing kindness to Spiritomb. For instance, when other Pokémon are scared of Spiritomb, Ash offers it some food. This simple act of kindness can be the first step. Then, as they face challenges together like a big storm or a group of wild Pokémon attacking them, they start to trust each other more. Each time Ash defends Spiritomb or Spiritomb uses its powers to help Ash, their bond gets stronger.