Icy mantles on interstellar dust grains are considered key contributors to the chemical complexity of the interstellar medium (ISM). Gas-phase molecules in the ISM can adsorb onto these icy surfaces, where chemical reactions can be induced by ultraviolet (UV) or cosmic ray (CR) irradiation. The resulting molecules can subsequently desorb, thereby altering the composition of the gas phase in the ISM. Therefore, studying astrochemically relevant reactions within ices is essential for advancing our understanding of astrochemistry. We conducted experiments with pure methanol (CH OH), pure methylamine (CH NH ), and CH OH:CH NH ices. To simulate CR effects, ices were irradiated with 5 keV electrons. We integrated the advantages of ice experiments and noble gas matrix experiments by performing two distinct investigations on each sample. During temperature-programmed desorption (TPD), chemical changes in the ice samples were monitored using Fourier transform infrared (FTIR) spectroscopy. Simultaneously, the desorbing molecules were trapped in an Ar matrix. This TPD-matrix-isolation (TPD-MI) redeposition process enabled FTIR spectroscopic identification of the desorbed species. The results obtained from experiments with CH OH and CH NH ices are consistent with previous studies. Additionally, the TPD-MI redeposition process enabled the identification of several species previously not detected clearly and directly in pure CH OH or CH NH ices, including molecules such as HCOOH, HCN, and CH CHNH. Our experiments with CH OH:CH NH mixtures revealed the formation of several nitrogen- and oxygen-containing organic species (CH NHCH OH, NH CH OH, NH CH CH OH, and HNCO), which are potential precursors to prebiotic molecules in the ISM. Therefore, these experiments provide valuable insights into the chemical evolution in space.