Write this in your theme’s functions.php file
function category_enqueue_script() {
$cat_education_id = 'xx'; // category id for "education"
$cat_dog_id = 'yy'; // category id for "dog"
if ( is_category() && ( is_category( $cat_education_id ) || is_category( $cat_dog_id ) ) ) {
wp_enqueue_script( 'my-js', 'filename.js', false );
}
}
add_action( 'wp_enqueue_scripts', 'category_enqueue_script' );