if $X$ counts the trial (roll) on which you finally get
a Success, the expected number of trials required is
$$E(X) = 1/p = \frac{1}{1/6} = 6.$$ See Wikipedia for
both of the definitions mentioned by @user158565. The first definition there is the one
I used just now.
Usually, an analytic proof for $E(X)$ uses moment generating functions or some sort of 'trick' using differentiation. (The Wikipedia article linked above shows such an analytic proof of the expectation for the second definition.)
However, using R as a calculator for your example, I can sum the first
one thousand terms is the infinite series
for $$E(X) = p + 2qp + 3q^2p + 4q^3p + \dots = \frac 1p,$$ where $p = 1/6, q = 1-p = 5/6.$ The remaining
terms (beyond $x = 1000)$ are so small that
the difference between the finite sum and the
infinite sum is negligible. (Summing the first 100 terms is not quite good enough.)
p = 1/6; q = 1-p
x = 1:1000; PDF = q^(x-1)*p
sum(x*PDF)
[1] 6
sum(PDF)
[1] 1
R statistical software uses the second definition, where $Y$ is the number of failures before the first success.
So in the following simulation to demonstrate $E(X),$ I use $E(Y+1) = E(X).$
I use a million
iterations (to get out of jail a million times)
in the simulation, so we can expect about 2-place accuracy.
set.seed(727) # for reproducibility
mean(rgeom(10^6, 1/6)+1)
[1] 5.992297 # aprx $E(X) = 6.$