please help me with this. what code should i write in the click function?
Here is a tutorial on how to play sounds in PlayCanvas
http://developer.playcanvas.com/en/tutorials/beginner/basic-audio/
In summary you need to add a sound component on an entity, assign an audio asset to a slot of the sound component and then play the sound by script like in the tutorial.