So a few quick things.
First, when you get a problem, please send us a screenshot and logs if possible to make it easier for us to identify your problem.
Second, when you're looking at an API in the documentation, be sure to look at the examples that they give as they contain lots of hints!
For example, the first snippit.lua in the computer api shows why your program doesn't work.
I'll demonstrate a working solution here.
Before you can call any methods, you have to assign the computer API to a variable.
What they usually do in the documentation is to call the variable 'computer' like so:
local computer = require("computer")
print(computer.totalMemory())
Because you didn't set the api to a variable first, your program tried to call a variable that doesn't exist and gave up.
Should be an easy problem to fix