You can do this in several different ways throughout your playthrough of the game, but one of the fastest is to learn the Soul Trap spell.
To start it, you’ll first need to have a Conjuration Skill of at least level 90 beforehand. To begin the process, you’ll want to head to the College of Winterhold, where you will ultimately start the side-quest to get the spell.