Dealing with timing issues can be a tricky situation, as it may be tempting to simply implement a "quick" browser.sleep() and move on.
However, this approach is not foolproof and may eventually fail. There is no one-size-fits-all rule for setting a sleep timeout, which means that at some point due to network, performance, or other factors, it could take longer for a page to load or an element to become visible. In fact, most of the time, you may end up waiting longer than necessary.
Instead, using browser.wait() offers a different solution. By providing an Expected Condition function for Protractor/WebDriverJS to execute, you can wait for the function to evaluate to true. Protractor will continuously run the function until the result evaluates to true or a set timeout is reached.
While there are several built-in Expected Conditions available, you also have the flexibility to create and use a custom one (example found here).