If I write a yantra and chant mantra for that yantra without guru diksha will it work ? Is Guru-diksha necessary for all yantras or some particular yantra's?
Yantra and most of the mantras come fom the Tantras. According to the Tantra scriptures, no worship or Japa can be done without diksha from a Guru.
The Gautamiya -Tantra says
dvijAtinAm anupanitAm svakarma-adhyanAdishu/yathA adhikaram nasti iha sandhyA-upAsanA-karmasu/tathA hi adikshitAnAm tu mantra-tantra-archanAdishu/na adhikaro'sti atah kuryAd AtmAnam shiva-sanskritam// (chapter 5).
Meaning: Just like twice-borns are not entitled to do sandhyavandana (with Gayatri mantra japa) and study of the scriptures, the people without diksha from Guru are not entitled to practice mantra, tantra and worship of the deities. Therefore one should get initiated.
Regarding yantra, you could refer to my answer : What is the overall role of Yantras? Are they used in Vedic ways of worship also?
One is free to chant any Name of his/her favourite deity and the Harekrishna Mahamantra without any initiation, but not to chant/japa bija-mantras and worship yantras.