Resistors ore not polarity conscious and so can be connected any way round. Diodes are, and the end of the diode marked with a bar or band should go towards the positive supply line.
Negatory! It's the other way around.
The bar, or band that PeterM mentions, denotes the Cathode end of the diode. The opposite end is the Anode. it is the
Anode that should be connected to positive.
Referring to the attachment, figures #1 and #2 show what happens when the diode is forward-biased and reversed-biased.
Figure #3 is the schematic equivalent of figure #1.
Figure #4
pictorial indicates which end of the diode is Anode and which is Cathode. Figure #4
schematic give a good indication of which way conventional current flows. It's illustrated by the diode 'arrow' pointing towards the Cathode. In other words, conventional current flows from the positive rail, through the diode and the lamp, then back through negative.
There are times when the diode needs to be reversed-biased. For instance, where a relay is used (Fig.5). In this instance, it's the
Cathode that is connected to positive.
I shan't bog you down with technical howdy-doody, but suffice to say that if you stick by these rules, everything should work good.