If you have a website with URLs like example.com/hello-world.html and if you want to redirect that to example.com/hello-world/, then you can try the below mentioned code. Copy/paste this into your .htaccess file. Make sure you replace example.com with your own URL.
RedirectMatch 301 ^/([^/]+).html$ http://example.com/$1
This should work fine, and if your website has 'https' instead of 'http', do change that as well.
Update - If the above code is not working for your website, you can try these instead:
RedirectMatch 301 ^/([^/]+)/([^/.]+).html$ /$1/$2/
RedirectMatch 301 ^/([^/]+)/([^/]+)/([^/.]+).html$ /$1/$2/$3/