If you’re the betting type, and you wager on whether a given word beginning with a prefix is attached directly to the root word or linked with a hyphen, bet against the hyphen: The trend—in American English, at least—is to close prefixed words and compound words. However, you won’t always win, because there are exceptions, even among words beginning with a particular prefix. Take the prefix co-, for example.
Using the Merriam-Webster’s website as the authority, we can see that virtually every word beginning with the prefix is closed. Exceptions include most words in which the root word begins with o, including co-official, co-organizer, and co-owner. Co-op takes a hyphen when it serves as an abbreviation for cooperative, even though the full term is not hyphenated—though it, like many other words containing prefixes, once was. (However, the unrelated term coop, referring to a shelter for birds or other animals, has no hyphen.)
In British English, which is generally more conservative about orthography and word treatment, the correct form is co-operative (and co-operate and co-operation). Co-opt, however, is standard in both dominant forms of English. An all-but-obsolete treatment of such words to signal that the o’s are separated by a syllabic break—this style quaintly persists in the pages of the New Yorker—is the inclusion of a diaresis (two dots) over the second instance.
Avoid attempting to attach the prefix to a phrase, as in “co-personal assistant,” which fails because it describes an assistant who is co-personal, not a personal assistant who shares responsibility with another person holding that title. A natural solution is to employ a slightly sturdier en dash in place of the hyphen to convey the prefix’s relationship to the entire phrase, not just the first word (equivalent to the stronger symbol’s usage in such phrases as “pre–Industrial Revolution”), but this strategy is not standard; instead, merely substitute co- with fellow.
Finally, avoid the prefix altogether if it is always redundant, as in copartner, and consider doing so if, in context, it is often so, as in co-conspirator.