Is it important to try an out-of-court solution before filing a lawsuit?
Yes, in most cases, legal action should be the last alternative. This is due to the costs involved with the process, not only financial, but also in terms of time and the uncertainty of the decision. The extrajudicial phase is never wasted, it serves as preparation for the process, so that the parties know each other's arguments and documents and are able to make a good assessment of the case, understand what the other party wants, estimate risks and outline a strategy of how to proceed and how much to insist on the process. From the judges' point of view, they appreciate a compositional stance rather than immediate judicialisation.
In some cases, however, the judicial measure is the only option, especially in emergency situations or when there is a risk of losing the right. This should be carefully assessed with your lawyer.