How do I get a node ID using slug?

I have a node whose slug is /node-21-company-name; I want to get the ID associated with this slug. How do I achieve this?

I know how to get the node entity by ID Node::load(id).