This isn’t quite an entry level topic, but to break it down for you, you would start but getting the direction of your stick input. Dark souls always rolls the direction you are pulling the left stick, that’s why you can still roll in any direction even when locked onto an enemy.
Dark souls then does some math to determine the distance you can roll based on your weight limit and equipped weight.
You define the end location of your roll based on this math and the left stick vector. Trigger a roll animation (this would look like the player is rolling on the spot if you saw it say in Maya). Then interpolate to the calculated location over a set time, say .5 seconds. Roll speed could be calculated or adjusted by stats too if you like.
You would trigger a bool at calculated times for dodge invincibility so tell the game if the player can be hit. This would also take certain stats into account like Dexterity or equip weight.
You would have to implement a ‘stop rolling’ function than cancels the roll lerp if you get hit outside of the invincible dodge period.
So this is a general outline of how it works in Dark Souls, I’ve simplified it a bit but should be enough to get a decent roll system up and running.