The concept of a Force ghost is present in the Star Wars saga. Fallen Jedi, such as Yoda and Obi-Wan Kenobi, may manifest as Force spirits. They’re blue phantasms that appear to other Jedi when they’re in need. In Harry Potter, fallen witches and wizards (and the occasional Muggle) frequently appear as blue apparitions to Harry himself before he sacrifices himself in the Forbidden Forest in Harry Potter and the Deathly Hallows Part 2.
There are also the ghosts who walk Hogwarts castle, notably Almost Headless Nick. These ghosts have no purpose in the series except to hide Horcruxes and provide comic relief. One of the best comparisons between the two is Yoda’s comical appearance in Star Wars: Episode VIII – The Last Jedi, when he giggles like a madman and destroys an ancient Jedi site with his mystical Force abilities.
In fact, a sequence in Star Wars: Episode IX – The Rise of Skywalker is nearly identical to one in Harry Potter and the Goblet of Fire. Rey uses her lightsabers against the Emperor and numerous Force ghosts appear to encourage her to resist in The Rise of Skywalker.
In the fifth book, when Harry is battling Voldemort in the graveyard, their wands create a blue wall of magic that expels people who have died at Voldemort’s wand, including Harry’s parents and Cedric Diggory. The two scenes have an appearance and feel that are quite similar. When it comes to apparitions, both franchises seem to favor the color blue; all of them return for a specific purpose and provide important voices of reason for the main characters in their respective stories.