For months, Hillary Clinton has all but ignored her chief rival for the Democratic presidential nomination, Sen. Bernie Sanders. That’s about to change.

With Democratic candidates set to debate for the first time on Tuesday, Mrs. Clinton has the tricky task of directly confronting the upstart Vermont senator, who has gained in polls, without alienating his passionate supporters. For Mr. Sanders, the debate is an opportunity to widen his appeal and persuade skeptical Democrats that he would be a viable nominee.

Since...