Inherited from Late Latin cofia, from Proto-West Germanic *kuffju. See also Middle High German kupfe (“cap”), Old High German kupphia (“cap”), English coif.
Practice speaking and memorizing "cofia" and many other words and sentences in Spanish.