Creation and Optical Characterization of Functional Defects in Two-Dimensional Materials