#If you don't want to release your weapon, yes
If a spell requires a material component (PHB, 203):
A spellcaster must have a hand free to access a spell's material components -- or to hold a spellcasting focus -- but it can be the same hand that he or she uses to perform somatic components.
Using a component pouch vs a spellcasting doesn't change the calculus. Both need to be accessed by a free hand.
In your case, you have one hand holding a sword and another hand equipping a shield.
That leaves you with zero available hands. Which means no material component access and no spellcasting for Material component required spells.
Unless you have an ability, such as the improved pact weapon invocation from Xanathar's Guide to Everything, you must meet the requirement of a free hand.
##You can still meet this requirement, but for a cost However, you can still create a free hand on your turn in order to cast a spell with a material component.
You can either drop your weapon or sheathe your weapon and then cast your spell.
The downside to this is that you no longer are wielding a weapon. This is important for things like opportunity attacks as well as any other mechanics, like that require you to be holding your weapon. And if you're wielding a sword a shield, odds are you are in melee combat. Of course, if you drop it, it is also at risk for being picked up or moved by an enemy.