Yanaka can easily be accessed from Nippori Station. Simply take the South Exit and use the foot bridge to cross the train tracks. The Yanaka area is the other side of the tracks and runs alongside Nippori Station.
From Shinjuku Station to Nippori Station:
Take the Yamanote Line direct to Nippori Station (20 minutes, ¥170)
From Tokyo Station to Nippori Station:
Take the Yamanote Line direct to Nippori Station (12 minutes, ¥160)