How to get data about category in category.php

OK, so there are many ways to solve this. You can use special template tags for some of these (for example the_archive_title to show the title of current category, and so on).

But to achieve all of these, you’ll need to get get_queried_object.

If you’re viewing category, this function will return current category object.

So after:

$current_cat = get_queried_object();

You can get its name using:

echo $current_cat->name;

And its id using:

echo $current_cat->term_id;

To get its parent:

if ( $current_car->parent ) {
    $parent = get_category( $current_car->parent ); 
    echo $parent->name;
    echo $parent->term_id;
}

And to get all subcategories of $parent:

$categories = get_categories( array('parent' => $parent->term_id) );
foreach($categories as $category) { 
    echo $category->name;
}