I play a wizard and while I am rarely hit due to being in the back I'm still paranoid I will get hit. So I was wondering if, after getting a feat to wield a shield, I can use that with one hand and use magic with the other?
This is explained on page 203 of the PHB under the Components section:
Spellcasting gestures might include a forceful gesticulation or an intricate set of gestures. If a spell requires a somatic component, the caster must have free use of at least one hand to perform these gestures.
A spellcaster must have a hand free to access these components, but it can be the same hand that he or she uses to perform somatic components.
Any spell that has either the Somatic or Material components can be cast while holding a shield, or weapon for that matter, in one hand so long as their other hand is free from obstructions.
If you also take the War Caster feat, you can cast spells with the somatic component even if both hands are occupied by a weapon and a shield:
You can perform the somatic components of spells even when you have weapons or a shield in one or both hands. (PHB pg.170)
If you're referring to the Moderately Armored feat, which is the only feat to grant proficiency in shields, then yes, you can carry a shield and cast with your other free hand. But note that the Moderately Armored feat requires proficiency in light armor first, which wizards also do not have.
If you don't have proficiency with the armor or shield you're using, you cannot cast spells at all.