kmonster: Essential for a comfortable playthrough are an arcane caster (sorcerer or (specialist) wizard) and a cleric who level as fast as possible. The rest is optional.
I recommend a sorcerer, spontaneous casting is great. Don't worry about the limited choice of spells to select, as a wizard you won't cast as many different spells as you can learn as sorcerer and you also have the option to cast from scrolls. Just choose wisely.
Priest deity isn't too important, just make sure your cleric isn't bad aligned, spontaneous healing is very useful.
I like battleguard of Tempus the most, only cleric spells as domain spells and the axe feats are useful.
A big difference compared to the previous IE games is that there aren't any items which set stats to a certain value, they raise the stats by a certain amount instead.
Warriors aren't as important in IWD2 as in IWD since the other classes get extra attacks now too.
There are more monsters than in IWD and they have far more HP (and some have damage reduction which subtracts damage from every attack), so make sure you can do damage fast, max strength for everyone you want to do physical damage (fighter, thief, ...) , else they'll feel useless compared to the casters and the game will feel slow.
Druids are useful, they can improve the party AC with barkskin and they offer additional options like pumping them up with as many lightning bolts and static charges as possible and watch them go off, free to so other stuff. They're best kept pure class.
Bards are also useful, with lingering song their singing is now 3 times as powerful as in IWD. They greatly increase physical damage output and help to defend versus attacks and spells.
I'm not a fan of pure fighters in IWD2, their bonus feats help the most in the beginning but get less and less useful since when the best ones are taken the remaining ones aren't that useful any more.
Other classes improve more at higher levels, casters get more powerful spells and barbarians get damage reduction every 3 levels after 10 for example, granting a better feeling of improvement. But pure fighters are playable nevertheless, besides maxed str take at least 13 dex since you need this for some of the best feats.
For traps/locks there are many options to handle. Locks can be bashed with a buffed strong character (or druid shapeshift) or opened with the knock spell.
Traps can be triggered and the damage taken, if you want to handle them properly without rogue level you need a character with high int since the int modifier both affects the skillpoints at level up you get and the search and disarm skill directly.
High int is needed by (specialist) wizards, so you could use a transmuter or diviner for this. Very popular is starting with a a rogue level for better skills.
Pure rogue works too, at level 15 rogues (and priests) get the 3rd attack per round just like fighters at level 11 and you get a sneak attack bonus every 2 levels and bonus feats starting at level 10, make sure strength is maxed for doing damage.
An option is mixing in a single barbarian level for free weapon proficiencies.
Another possibility is mixing in 4 fighter levels for weapon specialization or a single paladin level so you get the paladin dialogue options.
If you add 1-4 rogue levels to a fighter or another warrior class it slows down the attack progression by only one level.
If you mix rogue with another class always start with a rogue level for the extra skillpoints.
1 rogue switch to wizard next level.