Hi Sarah-7243,
You have to request a refresh token together with id/access token.
With the refresh token you can then request another id/access token when those will expire.
The refresh token has a much longer life.
More info at:
https://learn.microsoft.com/en-us/azure/active-directory/develop/refresh-tokens
Hope this helps!