How to prevent to direct access of my custom plugin folder/files

Well. If I’m not wrong, you are looking for a way to hide what files are in your plugin directory?

Just keep an index.php file in your plugin directory.

And as an extra layer of security, add this code at the very beginning of all of your PHP files-

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
    die();
}