written characters: yuē vs rì
I was secretly expecting this question. :)

In handwritten and calligraphic realization, these characters can be tough to distinguish, although the context will help you a lot.

In printed text, the middle 横 héng stroke in 曰 is not touching the right side of the character, in 日 the middle stroke is entirely through, at least in most fonts. If not, it is only the width of the character that can give you a clue and the context, of course.

Needless to say, 曰 is not very common today, it is mostly used in Confucian text, like 子曰, "The Master said...". So most of the time you see these characters in modern texts, chances are it is 日 and not 曰.  

The stroke order is the same.