Whether you're handed a picture of particles or a chemical formula, the same short questions sort it every time. Learn them and a diagram you've never seen still drops straight into a box.
The Two Questions, in Order
One — how many different kinds of particle are in the whole sample? If there's more than one kind of particle drifting around unbonded, it's a mixture and you can stop. (A “particle” here means whatever single unit travels on its own — a lone atom, or a bonded molecule.)
Two — if it's all one kind of particle, look inside it. All the same kind of atom? Element. Two or more different elements bonded together? Compound.
Reading a Formula
A chemical formula is just the recipe in shorthand, and it answers question two for you. O₂ means two oxygen atoms bonded — same element, so it's an element (an element can absolutely come as a molecule). H₂O means two hydrogens and one oxygen bonded — different elements, so it's a compound. Big letters are the elements; the little numbers count the atoms. If a formula has more than one capital-letter element joined together, you're looking at a compound.
Build the Three, Slowly
Make an element molecule. Snap two oxygen atoms together: one kind of particle, one kind of atom → element (O₂). Make a compound. Bond two hydrogens to an oxygen: one kind of particle, but two different elements joined → compound (H₂O). Make a mixture. Now drop some O₂ and some H₂O into the same box without bonding them across: two different particles, just neighbours → mixture. Same atoms as before, but because nothing new is bonded between them, the whole sample is a mixture. Build each in the toy and watch the classifier agree.