Materials manipulation via ion or laser beams can achieve precisely tuned atomic geometries that are necessary, e.g. to engineer interactions between defects in quantum materials and for fabricating novel electronic devices with nanoscale dimensions. In addition, such beams are also used to characterize and probe materials properties by means of electronic and optical excitations. I will discuss recent quantum- mechanical first-principles predictions for electron dynamics and the subsequent ionic motion that follows after an excitation of the electronic system. Using real-time time-dependent density functional theory we simulated the underlying ultrafast time scales of electron dynamics in semiconductors and metals. Examples include long-lived electronic excitations in proton, electron, and laser irradiated bulk semiconductors that facilitate diffusion of point defects, such as oxygen vacancies in MgO. We compare such bulk simulations to aluminum surfaces under irradiation, for which we quantify electron emission, charge capture, and pre-equilibrium effects that are unique to thin films or two-dimensional materials. Limitations and possible extensions of the theoretical description will be included in the discussion.