How to fix memory problem of a computer?

How to fix memory problem of a computer?
This is a three month old Celeron desktop computer. It all started about the time I started making new user accounts but every time I reboot my computer I hear continues and annoying sound that really bugs me off. And when I'm using my computer it suddenly restarts.
And when it restarts, I hears the annoying sound again. I don't know where it came from. I checked inside the CPU but I think its all okay. So I reboot my computer again to try it once again but nothing happen. My friend told me that could be the memory. How will I fix this problem?
