The law and the good, in European languages, are associated with straight lines; the bad with the crooked. Think about the word crooked itself, literally! Or about right/rectangle, or the Greek ortho- for straight, hence, orthodox as well as orthodontics.
This is why it makes sense that Derecho — Spanish for straight and also for law — comes from the same Latin root that gives us direct.
The “ct” in the original direct turned into a “ch” in Spanish, in the usual pattern of “ct” turning into “ch” as Latin grew into Spanish.
The Spanish for “chest”, pecho, sounds completely different than the English chest.
But it is related to the English word for the chest bones: the Pectoral Girdle.
The relationship is the Latin ‑ct- words transforming into ‑ch- as Latin turned into Spanish. Thus, the pect- maps to pech- exactly. The English word, on the other hand, is taken — unchanged — directly from the Latin.
Also from the same root, in Spanish, es pechuga — the common word for the common food, “chicken breast”!
The same pattern we see in noche/nocturnal, leche/lactose, etc.