If you believe your lawyer has been negligent and has not met their obligations, you should complain in the first instance to the provincial bar association. If the response is unsatisfactory, you can take your complaint to the regional and then national bar associations. Complaints should be in writing and in Spanish. A full list of the bar associations around Spain can be found on the website of the General Council of Spanish Lawyers.
If you have a complaint about the way a court has handled your case, you can present a complaint to the General Council of the Judiciary.
If you have a complaint against a notary or gestor administrativo, this should be directed to the professional council of which they are a member.