Domains and URL paths are a bit of a different consideration. I think most would agree that a keyword friendly domain can be a major help for SEO in various ways.
The URL itself is less of a signal these days, and so thinking too much about where in the URL keywords appear is probably too finicky.
However, as with any question that affects URLs, you need to make sure your URLs serve their major purpose as a user route into your site. If you have meaningful but short URLs, that should help SEO.
Generally, I would read from right to left in a URL - going from most specific information to least specific. So, www.youtube.com/watch?v=gRzMhlFZz9I is not great. www.youtube.com/entertainment/very-funny would tell a user (and a search engine) that you had something very funny, filed under entertainment, in a site named youtube.
A quick test that can help you evaluate the search engine impact of keywords in URLs is to compare results for a keyword to results for the same search without the keyword in the URL, e.g.