I am not a network support person, and only a novice at these things about php.
In my own case, I have decided to run only one version of php on my VPS server. When I was setting up my server, I was seeing that one could run two versions of php (5 and 7), but it seemed to complicate things for my simple mind. So I decided to keep my server at php 7.
Maybe others here will be able to guide you. It's a server issue, not a Moodle issue.
Having said this, since my Moodle is small, I do run Moodle on my Mac in a MAMP install for experimental purposes. Since you are practicing and learning, you might want to try installing one of the AMP products on your computer. MAMP does provide me a control panel where I can easily switch between php 5 and 7. When I want to run my older Moodle 2.9 product, I simply switch to php 5. But when I want to experiment with my newer Moodle 3.6, I switch to php 7.
Maybe one could do the same thing on their production server?