Be it Arduino or any other Microcontroller the testing and debugging method is the same.

These methods are discussed based in personnel experience.

Check you connections: Most of the the problem will be your connections. Since we use a pre-tested library for our LCD displays there are very less chance for your code to be wrong. Instead concentrate on your connections make sure you have connected to the correct digital pins of the MCU.

Power up display: After making the connection when you power on the LCD, even if there is no code on the MCU you LCD should display boxes as shown below

Check your contrast pin: Another trouble maker is your contrast pin (3rd pin). Make sure this pin is connected to a potentiometer and vary the pot till you something on the screen. Because sometimes your LCD might be working just fine but your contrast level might be too low or high for you to visualize it.

Have a handy replacement: Sometimes the crude way is the best way. If you are still struggling to get it work. Try replacing it with a new LCD if the new also ones also does not work then the problem is with your code or connections. LCD displays can be easily damaged by normal reverse polarity or over voltage so having a replacement just in case is a good idea