How do I go about intentionally aliasing a signal, and upsampling work with audio file in MATLAB
If you want to downsample in a way that produces aliasing, just throw away some fraction of the samples, ie, only keep every 2nd sample, etc.

If you want to downsample in a way that doesn't alias, precede the decimation with a lowpass filter having a cutoff below the nyquist frequency of the sample rate you'll have after you decimate.  Since decimating involves throwing away samples and an FIR lowpass filter has no future dependence on its results, you don't have to bother doing a convolution dot product for the outputs you'd only discard in the decimation, instead you can just skip to the next one.

To upsample, insert zeroes between the input samples (use zeroes, do not repeate the input values).  This produces alias frequencies, so follow with a lowpass filter below the nyquist rate of the original sample rate.  Again, you can design the convolution computation to skip over the zero inputs.

For small integer ratios of sample rates, discarding or zero inserting samples and FIR filters work very well.  For larger ratios, CIC filters may be preferred as they can be efficiently computed in hardware using wrapping binary computation (you intentionally let the calculations overflow!), though they have a sinc function-shaped rather than rectangular frequency response and so need a clean up filter to select only the rectangular area near the tip of the sinc response and/or compensate for the droop of the sinc.