Spell slots are the fuel you spend to cast spells.
For now, think of cantrips as being totally separate from spells.
All spellcasters, including warlocks, have a list of spells they can cast, through some combination of knowledge and preparation (the details vary by class). These spells all have levels — comprehend languages is a first-level spell, shatter is second-level, hold monster is fifth-level, etc.
Then (PHB, p.201):
When a character casts a spell, he or she expends a slot of that spell’s level or higher.
So to cast comprehend languages, you need to "spend" at least a first-level spell slot, but to cast hold monster you need to spend a fifth-level spell slot.
Most spellcasting classes — warlocks being the exception — have different numbers of slots of different levels. For example, a 9th-level wizard has four 1st-level slots, three each of second, third and fourth-level slots, and one fifth-level slot.
Warlocks are a bit different because they have a smaller number of slots, but all of the slots are of the same level. At first level, a warlock has one first-level slot, but at 9th level they have two fifth-level slots (but no slots of any lower levels).
When you cast a spell using a slot of a higher level than the spell — for example, casting shatter (a second-level spell) using a fifth-level slot — the spell may have increased effects. Shatter does extra damage when cast using a slot higher than second level. Other spells, such as comprehend languages have the same effects regardless of the spell slot used to cast them.
Once a warlock has spent their spell slots — at ninth level, once they have cast two spells — they can't cast any more spells (again, setting aside cantrips) until they've recovered their spell slots. Most spellcasters need a long rest (eight hours) to recover spell slots, but again warlocks are different, and recover all of their slots after a short rest (one hour).
To sum up, for a warlock:
- The spells you know dictate what you can use your spell slots for.
- You don't ever "use up" a known spell.
- You spend a spell slot to cast a spell you know. After that, the spell slot is gone, but you still know the spell.
Warlocks can swap known spells as they gain levels.
From the Known Spells of 1st Level and Higher section of the Warlock class description: (PHB, p. 107):
Additionally, when you gain a level in this class, you can choose one of the warlock spells you know and replace it with another spell from the warlock spell list, which also must be of a level for which you have spell slots.
For example when a warlock goes from 3rd to 4th level, their known spells goes from four to five (per the table on p. 107 of the PHB), so that warlock can add a new known spells of first or second level, and replace one of the first or second level spells they already know with another first or second level spell. This is how most warlocks will "upgrade" low-level known spells they don't need into more useful higher-level spells.
You only have one pool of slots
You cast whatever spells you can cast, in whatever manner you cast them. They use slots, which are a generic resource independent of your specific spellcasting class. There aren't 'Wizard' or 'Cleric' slots, for example - just 'spell slots'. So your PC might cast only Eldritch Knight spells with all their slots or only Wizard spells with all their slots or some combination of both.
So, yes, you should ignore the class tables and just look at the table for multiclass spellcasters.
Best Answer
Casting spells is different from knowing/preparing spells. The only connection is that when you cast a spell, it must be from those you know or have prepared (with limited exceptions for some rituals). There are 3 tables for how many spellslots a character has to cast with -- 1 for full spellcasters (wizard, cleric, bard, druid, sorcerer), 1 for half casters (rangers and paladins), and 1 for third casters (eldritch knights and arcane tricksters). Warlocks have a different system for this.
Know or preparing spells is different.
Wizards, clerics, druids, and paladins prepare spells -- each has a number of spells they can prepare, and can change them after a long rest. On that day, they can only cast those spells, using their spellslots to do so. Clerics, druids, and paladins choose the spells they have prepared for the day from the entire list of spells; wizards choose from those they have in their spellbooks.
Bards, rangers, warlocks, sorcerers, arcane tricksters, and eldritch knights are much more limited in spell selection. For each of these classes, in their class table it says how many spells the character may know at any given level. When they go up a level, they check that table to see if the number of spells they know goes up; if so, they pick a new spell (or spells if it goes up by more than one) to add. At leveling up, they also have the option to change one spell they know to a new one that they can cast.
When the spellcaster casts a spell, this does not in any way affect which spells he knows or has prepared. Those do not change with casting; each time he casts a spell, he can cast any spell that he knows or has prepared, using a spell slot equal to or greater than the level of the spell he chooses to cast.
So, to answer your request for examples:
A 5th level ranger knows 4 spells. He has just gained the ability to cast 2nd level spells, so he can at most know 2 of those (one for the spell he gained at 5th level, and one could be changed from one of the 1st level spells he knew previously). The other 2 spells he knows will be 1st level spells. He has 4 1st level and 2 2nd level spell slots with which to cast those spells he knows.
A 5th level paladin can prepare a number of spells equal to his charisma modifier, plus 2 for his level. So, for example, if the paladin has a 16 charisma, his modifier is +3, and so at 5th level he can prepare 5 spells. After each long rest, he either keeps the spells he has prepared, or spends a few minutes preparing a different set, from the paladin spell list. He can prepare 1st and 2nd level spells (since that is what he is able to cast), in any combination. He has 4 1st level and 2 2nd level spell slots with which to cast those spells he has prepared.