Early in the backstory that is Solo, Han has been sentenced to death – sent to “the beast” who is tacitly implied to eat him. The guards chain his leg and drop him in a pit. They lay bets on how long Han will survive and jeer that they want it to last a while – for their entertainment.
At the other end of the chain is the beast himself – a seven foot tall “walking carpet” as Princess Leia will admonish later. So the wookie is captive as well, most likely starved physically. Most likely, too, he has been taunted and terrorized into a survival mode, killing those that come into the pit with him. Now fate has chained the two unlikely good guys together.
Han only gets a moment of mercy before he can do the one thing apparently no one else has – talk to Chewy in his language. That gives him just enough time to put together the situation and the weakness in their combined captivity that can be overcome – together. That is enough. That’s the only way it will work.
We won’t see Han speak wookie in the original series, but we know Han well understands Chewy’s intonations.
The next time you’re in a dire – or maybe uncomfortable- situation, you may be at odds with a coworker or the other party in a car accident. Make sure to pay attention to the details around you. There may be a way out that no one else has seen. You may need that other person to make it out quickly, or profitably or safely. And for goodness sake, speak their language!