Show category name in the post URL only for specific categories

The easiest way would be to create a custom post type with an archive.

<?php
register_post_type('resource',
    array(
        // Enable Core Categories and Tags
        'taxonomies'        => array('category', 'post_tag'),
        // Enable in REST API so it works with the Block Editor
        'show_in_rest'      => true,
        'label' => 'Resources',
        'public'            => true,
        'supports'          => array('title', 'editor', 'excerpt', 'thumbnail', 'revisions'),
        // Archive URL will be example.com/resources
        'has_archive'       => 'resources',
        // Posts will be at example.com/resources/postname
        'rewrite'           => array('slug' => 'resources')
    )
);
?>

This will create the post type itself. Then, you can go into the database and change their post_type from post to resource – or you could create PHP code to do this for you if you’re not comfortable editing directly in the database.