Kindly follow these steps to install TestNG
Open eclipse and go to the Help and then click on Install New Software...
Then on the Next to Work with: enter the following URL
It will show TestNG
click on Next two times, accept the terms and conditions and click finish.
Click install anyway on this window
and it should show installing software on the bottom right corner of eclipse.
Next, click on restart now to restart eclipse and TestNG should be installed on your system.