To combine them without losing their essence, keep their core traits. For Harry, his loyalty and courage should remain. So in the fanfiction, when facing a new threat in the Star Wars universe, he stands by Leia with unwavering loyalty. For Leia, her leadership and determination are key. She could lead Harry and other characters in a battle against a combined dark force. For example, if there's a dark wizard - Sith alliance, she'd be at the forefront of the resistance.
In a fanfiction, it's important to remember the values that Harry and Leia uphold. Harry values friendship and the fight against bigotry in the wizarding world. Leia values freedom and justice in the Star Wars galaxy. They could come together when a new form of oppression emerges that combines elements of the wizarding world's prejudice and the Empire's tyranny. Harry could use magic to expose the truth about this new evil, while Leia uses her influence and leadership to rally support. Their combined efforts would be based on their individual values, thus keeping their essence intact.
One way is to focus on their backstories. Harry grew up in a world where he was an orphan and had to face a lot of hardships. Leia was a princess who lost her planet. In the fanfiction, they can bond over their shared experiences of loss. They can also learn from each other's strengths. Harry can show Leia how to use magic for stealth and protection, while Leia can teach Harry about strategic planning and political maneuvering. This way, their individual essences are maintained while they interact in a new and exciting story.