If I understand your question correctly I think I have an answer.
If you are referring ONLY to diatomic then here it goes.
Q: What is a diatomic?
A: A molecule that naturally exist with 2 elements - ex. O2 - the reason for this is the molecule is not stable enough to exist alone.
Q: How do you know its a diatomic?
A: On the periodic table the trick is it go to element 7 and make a 7, so N,O, F, Cl, Br, and I.
Q: How do I name diatomics?
A: Your example, O2, would be Oxygen. The reason you wouldn't say di-oxygen is because it is naturally in the diatomic state. If you know what elements are diatomic ("go to 7, make a 7") then you can write the structure easily.
ex. Iodine = I2
Bromine = Br2
N2 = Nitrogen
Hope this helps!
Senior Chemistry and Chemical Engineering Student