For pity’s sake, watch the show first.
And not just one episode, but at least ten of the significant ones. And that’s episodes the fans think are significant, not the producers. The fans will know and love their show, and will know exactly what is important.
And when you write, close your eyes, and listen. Can you hear your words spoken in the characters’ voices? Because you should, if you’re writing in the spirit of the show.
I love sci-fi, and I have seen some wonderful sci-fi episodes written by guest writers. I have also seen some dire episodes written by people who have obviously never seen an episode of the show they are writing for, and boy, does it show. (His name is NOT Doctor Who! – although to be fair, that particular episode was around 40 years ago. Everyone writing for Doctor Who these days are obviously dyed-in-the-wool fans, and damn good writers.).
To write for a TV show well, you have to become a fanfic author. And you have to start off by being a fan.