echo "PATH=/opt/plesk/php/7.1/bin:$PATH" >> ~/.bash_profile
Replace the version number with the one you have set.
Then close out the terminal and reopen. Run php -v and you should see the correct version.
php -v PHP 7.4.27 (cli) (built: Dec 23 2021 14:48:17) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with the ionCube PHP Loader + ionCube24 v10.4.5, Copyright (c) 2002-2020, by ionCube Ltd. with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies