Q:

How to group 2 radio buttons in a widget?

the related code is →
<p> <input type="radio" <?php checked( $instance[ 'check_for_counter' ], 'on' ); ?> id="<?php echo $this->get_field_id( 'check_for_counter' ); ?>" name="<?php echo $this->get_field_name( 'check_for_counter' ); ?>" />
    <label for="<?php echo $this->get_field_id( 'check_for_counter' ); ?>">Check whether to display description or not</label> </p>

    <p> <input type="radio" <?php checked( $instance[ 'check_for_image' ], 'on' ); ?> id="<?php echo $this->get_field_id( 'check_for_image' ); ?>" name="<?php echo $this->get_field_name( 'check_for_image' ); ?>" />
    <label for="<?php echo $this->get_field_id( 'check_for_image' ); ?>">Select to Post with Thumbnails</label> </p>

QUESTION →
Double radio button checked in widget: How to Fix this?
checked doesn't work in radio buttons?

A:

The question does not call for WordPress, but it was long to include it in a comment, so here we go.
If you want to group your radio buttons, you should specify a name for them. To assign a value, you should change the value property, unlike other form elements.
So, let's have a simple form with 2 radio buttons:
<form action="">
  <input type="radio" name="sample" value="1">Value1<br>
  <input type="radio" name="sample" value="2">Value2<br>
</form>

Now you can get the value of your radio button on the server by using $_GET['sample'].
This will turn your code into the following:
<p> 
    <input 
        type="radio" 
        <?php checked( $instance[ 'what_to_check_for' ], 'check_for_counter' ); ?> 
        id="<?php echo $this->get_field_id( 'check_for_counter' ); ?>" 
        name="<?php echo $this->get_field_name('what_to_check_for'); ?>"
        value="check_for_counter"       
    />
    <label for="<?php echo $this->get_field_id( 'check_for_counter' ); ?>">Check whether to display description or not</label> 
</p>

<p>
    <input 
        type="radio" 
        <?php checked( $instance[ 'what_to_check_for' ], 'check_for_image' ); ?> 
        id="<?php echo $this->get_field_id( 'check_for_image' ); ?>" 
        name="<?php echo $this->get_field_name('what_to_check_for'); ?>" 
        value="check_for_image" 
    />
    <label for="<?php echo $this->get_field_id( 'check_for_image' ); ?>">Select to Post with Thumbnails</label>
</p>

You can now get the value of what_to_check_for, and if it was check_for_image, then the second radio button is selected. If it was check_for_counter, the first one is selected.

