Custom function wordpress php

You must be thinking something like this:

In this URL: https://myawesomewebsite.com/page?custom_id=456

function check_parameter_in_url() {
    if ( isset( $_GET['custom_id'] ) {
        //do something
    }
}

tech