It's a common issue with RAM and swap. There are not enough memory. With Ubuntu 18.04 both memories should be greater than 1 GB . The load is often more than 90 % respectively.
With a bit of luck you can check it with
System Load Indicator
(First I have removed Firefox in the graphical surface and then
sudo apt install firefox in the Terminal)
It's a common issue with RAM and swap. There are not enough memory. With Ubuntu 18.04 both memories should be greater than 1 GB . The load is often more than 90 % respectively.
With a bit of luck you can check it with
System Load Indicator
(First I have removed Firefox in the graphical surface and then
sudo apt install firefox in the Terminal)