Fail to connect (Connectionfailed)

Hi, i can’t find my mates server this is really bugging me and he came up with a solution he gave me the server ip and port and it works for 1 day the next day i get on and try to connect doing the net.connect XXXXXXXXXXXXXXXX ip and port and it says “Fail to connect (Connectionfailed)” and ideas on how to fix this