plugin_dir_url( __FILE__ ) not working in my wordpress plugin development

Solution:

Use plugin_dir_url( __FILE__ ); for the URL and plugin_dir_path( __FILE__ ); for the path.

Pass the plugin’s main file to both functions to get similar results.

plugins_url( string $path = '', string $plugin = '' )

Retrieves a URL within the plugins or mu-plugins directory.

For more information