Multiclass spellcasting in 5E is a bit of a complicated affair, as there are a few different ways to calculate your total number of spell slots. The first thing you need to do is determine which classes grant you access to spellcasting, and then add together the total number of slots from all of those classes. Here’s a breakdown of how many slots each class gets:
If you’re multiclassing into a class that doesn’t have any spellcasting abilities, then you don’t get any additional spell slots. So, for example, if you’re a barbarian 2/wizard 6, you would have a total of 6 wizard spell slots (2 from your 2nd level, and 4 from your 6th level).
Once you’ve determined the total number of spell slots you have available, you can start filling them up with spells. You can choose any spells you want from your available classes, and can change them out as often as you like (during a long rest).
Just keep in mind that you can only cast each spell once per day (unless you’ve found some way to recharge your spells, like the sorcerer’s Metamagic ability).
So, to sum up, the process for calculating your multiclass spell slots is as follows:
1. Determine which classes grant you access to spellcasting.
2. Add together the total number of slots from all of those classes.
3. Fill those slots with whatever spells you want.