This manuscript summarizes the different technological developments and scientific activities in the field of ultrafast laser and electron physics which I have carried out as part of my PhD thesis. The topics addressed in my thesis range from the development of a novel electron gun to the construction and operation of a coherent X-ray laser, which I used for the study of ultrafast magnetization dynamics. The work was carried out within the frame of SwissFEL at the Paul Scherrer Institute. Electron sources with a very good beam quality are a prerequisite for the realization of compact free electron lasers. In the first part of my work I will describe a novel electron cathode, which is based on a micro-structured surface. The cathode offers a quantum efficiency 2 orders of magnitude larger than what is achieved with conventional metallic cathodes. Then I will describe a table-top soft x-ray source based on HHG where I have played a major role in the construction and commissioning. The generated attosecond pulse train from this source has been characterized by means of a newly developed Terahertz streak camera. Furthermore, first attempts have been made to extend the the spectral range offered by HHG to significantly higher photon energies (up to 400 eV) using an intense mid-infrared laser. Such a source will enable new science applications in near future. Finally, the ultrashort x-ray pulses were used to study ultrafast magnetic dynamics in Cobalt thin films. For this purpose two different techniques, namely XMCD and X-ray magneto-optical effect were implemented and tested at the HHG beamline and first studies on ultrafast magnetization were successfully performed.