How to create a collapsible Navbar?

I want to create a navbar that collapses into a button when the screen size is small. I was reading an article on Tutorialspoint on how to do that. But how do I mention the screen size for which the navbar needs to be collapsed?

Here is the link:

You don’t. It collapses for xs screens.

If you need to change this: