How can i update php version inside a pod containing WordPress website?

I want to update php version from 8.0 to 8.1 on a pod containing a wordpress website

Do i need to just download image of new php version8.1?
else do i need to download the wordpress image also?

Dos this affect my present running site like loosing data and settings ?