How to record and play an audio

Hi everyone! Sorry for the silly question, but I have many problems with the recording and the play functions for an audio. In particular I get confused with the variables that I need to use. Can someone please help me?