Leave Kudanshita Station from Exit 1, and walk directly forward for three minutes. You will see the entrance to Yasukuni Shrine marked by a large torii gate.
From Shinjuku Station to Kudanshita Station:
Take the Shinjuku Line direct to Kudanshita Station (8 minutes, ¥220)
From Tokyo Station to Kudanshita Station:
Take the Marunouchi Line to Otemachi Station, change trains to the Tozai Line to Kudanshita Station (5 minutes, ¥170)