Ideal Diode in two sources circuit
For this type of DC circuit analysis, think of an "ideal" diode as an automatic, SPST switch.  When the current is tying to move the same direction that the diode symbol points, the switch is closed and electrons flow.  When the current is trying to move in the opposite direction, the switch is open and there is no current.  Note that it is the polarity of the voltage across the diode that the diode actually responds to, but the shape of a diode symbol is a convenient way to visualize what is going on.