If this is a New Recent problem
then you should *probably* try to figure out What Changed Recently to cause it.
tightening the cable might fix if, but you should ask: why/how did it become loose in the first place?
a damaged cable or housing?
cable clamp slipped?
derailer mounting clamp moved or misaligned?
etc.