Try using wp_redirect($url). See https://developer.wordpress.org/reference/functions/wp_redirect/ .
So…something like:
// set up the URL to redirect to
$redirect_to = 'https://www.example.com/page';
wp_redirect($redirect_to);
exit;
Note that exit is required to close out the code. See the docs in the above link.