the oxygen has some lone pairs of electrons (an oxygen atom has 6 outer shell electrons; the oxygen in OH^- has 8 outer shell electrons: one has been gained (hence the ion), and the covalent bond between the oxygen and the hydrogen contains one of oxygen's electrons and hydrogen's electron, the oxygen has 4 non-bonding electrons, which exist as "lone pairs") one of these lone pairs (remember electrons are negatively charged) is attracted to the positively charged carbon (a carbon atom normally has 4 outer shell electrons; in CH3^+ one of these electrons has been lost, and the remaining three are each in a covalent bond with a hydrogen)
remember a covalent bond is a shared pair of electrons. atoms in simple molecules are held together by covalent bonds. in a simple molecule there is a set number of each atom (you know how many carbons, oxygens, hydrogens (or whatever) there are in one molecule). this is true for methanol
ionic bonding is the electrostatic force of attraction between oppositely charged ions. an ionic compound contains many oppositely charged ions (NaCl, for example, contains many Na+ ions and many Cl- ions, not just one of each), arranged in a giant lattice (i.e. not methanol)
Spoiler
apologies if this is just more confusing, there's probably a better way to explain it!
not sure what level you are studying, but chemguide usually has some good explanations. it mainly has a-level content but there is also a section covering GCSE chemistry content. would recommend
Thank you! This really cleared up my confusion. Just to confirm, CH3 that is the methyl molecule has in total 6 electrons, 3 of carbon and the other 3 from each of the hydrogens, right?
-CH3 = methyl by itself it's not really a molecule; it tends to be part of a molecule, often as a methyl group think of it as a methane molecule (CH4) that has lost the hydrogen. something else is usually bonded (or about to be bonded) to the carbon in place of this hydrogen in this case it is a methyl cation (a cation is a positive ion). in the carbon's outer shell there are 3 pairs (6 total electrons) of shared electrons, each pair is shared with a hydrogen. each shared pair effectively consists of one electron from the hydrogen and one electron from the carbon atoms are generally most stable when they have a full outer shell. the carbon therefore needs two more electrons to complete its outer shell, which are coming from one of the lone pairs on the oxygen, again a shared pair of electrons (covalent bond) so that both the carbon and the oxygen can have a full outer shell
-CH3 = methyl by itself it's not really a molecule; it tends to be part of a molecule, often as a methyl group think of it as a methane molecule (CH4) that has lost the hydrogen. something else is usually bonded (or about to be bonded) to the carbon in place of this hydrogen in this case it is a methyl cation (a cation is a positive ion). in the carbon's outer shell there are 3 pairs (6 total electrons) of shared electrons, each pair is shared with a hydrogen. each shared pair effectively consists of one electron from the hydrogen and one electron from the carbon atoms are generally most stable when they have a full outer shell. the carbon therefore needs two more electrons to complete its outer shell, which are coming from one of the lone pairs on the oxygen, again a shared pair of electrons (covalent bond) so that both the carbon and the oxygen can have a full outer shell