power.sim and time.sim are not base R functions so they must come from some R package that you need to install and load in your session.
Check the material you are following, at some point they must mention the origin of the functions or what packages you need to install.