Most people seek to project an upbeat, confident attitude on the job. But sometimes it is better to be a worrywart.

While ample research has documented the benefits of optimism at work, dozens of studies in the past several years have explored the flip side of the coin—how a moderate amount of pessimism can yield better performance.

A little worry can motivate people to be more persistent in doing difficult tasks, studies show. Some people actually summon up a certain amount of worry or fear before starting especially tough assignments, research shows. Others who are too cheery learn to recruit downbeat colleagues to provide some of the caution or realism they need.

As an actuarial consultant, Kathy Blum plows through large amounts of data to investigate cases of alleged negligence by accounting firms. Worrying motivates her to examine details in a variety of ways for evidence of misdeeds and to continue mulling over cases in her off hours, says the president and co-owner of The Kilbourne Co., a San Diego actuarial consulting firm. Sometimes, “a solution will pop to mind when I’m not at work,” she says.

Maintaining “a certain level of skepticism, or a lack of trust,” helps her persist in examining and re-examining defendants’ claims for inconsistencies or errors, Ms. Blum says. She tells herself that if she isn’t as thorough and accurate as possible and a case takes a wrong turn, “it’s just going to haunt me for a long time.”

Certain occupations, including actuarial science, accounting, engineering and computer science, tend to be a better fit for people with a realistic, detail-focused mind-set, research shows. These jobs are also less likely to pose obstacles for those who are pessimistic or worried.

Click for more from The Wall Street Journal.