When it comes to SEO (Search Engine optimization) details is very important
one the very important details is to have the right user friendly and good structural URL for the search engine to read and index the keywords in it
A lot of developers favor separating words in file names with underscores (_) instead of hyphens (-). They are conditioned to this behavior because some programming languages reserve the hyphen, for example, as the subtraction infix operator.
Search engines treat dashes and underscores differently from one another. Google has clearly stated that when it comes to URL structure, using hyphens rather than underscores makes it much easier for them to identify what the page is about.
but again this is for the new websites not for the old reputable website that is well indexed
here is a different opinion https://
The recurring question in SEO URLs is whether to use a hyphen, or dash, (these-are-hyphens) or an underscore (these_are_underscores) to separate your words. Does Google recognize both of them as word separators?
The short answer is that you should use a hyphen for your SEO URLs. Google treats a hyphen as a word separator, but does not treat an underscore that way. Google treats and underscore as a word joiner — so red_sneakers is the same as redsneakers to Google. This has been confirmed directly by Google themselves, including the fact that using dashes over underscores will have a (minor) ranking benefit.
I recommend using the hyphen
have a good SEO day :)