Ruddlesden–Popper Perovskites: Synthesis and Optical Properties for Optoelectronic Applications