A few novels are direct sequels to TV episodes. Usually in those instances, the "historian's note" suggests the episode you should see first. A great many TOS and TNG books are fairly standalone, requiring only basic knowledge of the characters and setting to be enjoyed.
says, don't attempt the post-series stuff unless you've seen the series' they're based on since they're direct continuations. Although it may be interesting to try some of the earlier, standalone DS9, Voyager and Enterprise novels prior to seeing the shows - just to compare the mental image of the characters you get from the books to the on-screen versions.