Often times when I tutor organic, I relate it back to pKa because acid/base chemistry and nucleophiles/electrophiles really go hand in hand, but they differ slightly. H20 has a pKa of 15. HCN has a pKa of 9ish. How does that help?
Well for example, HCl (a classic strong gen chem acid) has a pKa around -7. We know that strong acids ionize 100%. One definition of an acid is that they like the donate protons (a hydrogen w.o its electron, H+)Why is that? That's where organic comes in. The formation of a more stable conjugate base is what we say often happens. HCl dissociates in water. -7 pKa vs 15 pKa. The -7 wins and so it acts as an acid when you drop it in water.
So if we have H2O and HCN in solution, 9 ish beats 15 and hydrogen cyanide wants to lose its proton more than water does. Whoever wants to lose their proton more will form the more stable/weaker conjugate base. Another way to look at it is by looking at the conjugate bases themselves. -OH has three lone pairs which are localized. -CN has a lone pair which appears localized on a C (which would make for a strong base), BUT that lone pair is actually resonating with the nitrogen and you should know that resonance lowers the reactivity and increases the stability of a base (making it a weaker one). -OH doesn't mind sharing those electrons to satisfy its charge. -CN is already satisfying its charge.
Its also important to note that base/nucleophile differ at some points. Base strength, imo, is the ability to pluck protons or donate electrons whereas nucleophile strength is based on how violently you attack an electron poor site/atom. I am not comftable explaining why -CN is a great nucleophile but you should just know that for substitution/elimination reactions, it always goes the substitution route whereas -OH can lead to a mixture of products sometimes
stable leaving groups typically deal with atoms that can bear negative charges well (Halogens and your column 6 Oxygen