Installing the correct drivers for gtx1070

Hey,
I recently bought a laptop with an nvidia gtx 1070. I Cleaned the original OS and installed ubuntu 18.04. I cant get nvidia-smi to work. What can I do about this?
I have tried to run the following in terminal:
sudo apt install nvidia-390
and rebooted my system. It rebooted with very low screen resolution.

then when i ran nvidia-smi, It said :
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Has anyone else faced a similar issue /How do i fix it?