All legal action can only be taken once notice has been served upon the entity or individual you wish to take to court. It is only this process that legalises bringing a matter to court. The intimation sent is known as a legal notice.
A legal notice is, therefore, a formal communication to a person or an entity, informing the other party of your intention to undertake legal proceedings against them.
This notice, when sent, conveys your intention before the legal proceedings and thus, makes the party aware of your grievance. Many times, a legal notice served will bring the other party on heels, and the problem can get resolved out of court too, with fruitful discussions on both sides.