First, decide which other franchise or story you want to cross over with. Then, think about how the characters from both worlds will interact. For example, if it's a Scooby Doo and Batman crossover, consider how Scooby and the gang would react to Gotham City and Batman's serious nature. Also, come up with a unique mystery that ties into both universes. Maybe the Joker has teamed up with a Scooby Doo villain to steal something important.
To start a Scooby Doo crossover fanfic, you should study the characters from both the Scooby Doo world and the other world you're crossing over with. Know their quirks, strengths, and weaknesses. Let's say it's a crossover with the Ghostbusters. You need to understand how the Ghostbusters operate and how Scooby Doo's gang approaches mysteries. Then, start writing the opening scene. It could be something exciting like the Mystery Inc. gang receiving a strange signal that leads them to the Ghostbusters' headquarters.
Begin by creating a basic plot outline. If you're doing a Scooby Doo and Star Wars crossover, you could start with the gang somehow getting transported to a Star Wars planet. Then, they have to figure out how to get back home while also helping the rebels (or the empire, for a different twist) solve a mystery. Think about the personalities of the characters and how they would play off each other. Shaggy might be really into the strange alien foods, for instance.