A convenient way to visit Yamadera is to take the Shinkansen to Yamagata and spend a few days exploring the area. It is nestled in between mountains, and if you get the right hotel room you will have a spectacular view. From Yamagata Station you can catch a local train that will take you directly to the foot of Yamadera.
You will be climbing all the way to the lookout spot you can barely see at the top of the mountain. It is a hike with 1000 stairs, but you are shaded by the beautiful trees, and have many opportunities to stop and take in the scenery and shrines of Yamadera.
About half way you will see this site, that is incasing what appears to be Oni, if you dare look inside.
While the hike is less than easy, once you reach the top you are no longer thinking about the hundreds of stairs you had to ascend to make it there. And I have to admit, fall weather was a blessing, I could not imagine making that climb in the summer heat and humidity!
After exploring the temple at the top of the mountain you begin the climb down, which is significantly easier than the climb up. I highly recommend taking lots of water, and a snack. But if you don't you will have an opportunity to purchase them during the hike (more towards the top of the mountain). You can even bring your mail and drop it off!
Once you reach the bottom of the mountain, before you head into the city, there is a lot you can explore. There were beautiful shrines and gardens that you can get lost in. You may even find a shrine cat!
Before you hop on that train and head back to Yamagata (or wherever your next destination is), take a chance to reward yourself and enjoy some local food. The area is known for it's soba, so I would recommend finding a little shop in the town and taking a break.
There are also many small shops that you can buy souvenirs at, and I must say they had some beautiful things.
If you want to go deep into rural Japan, you will not be let down when you visit Yamadera. Not going to lie, when I got to the top I almost cried because of how overwhelmed I was from the beauty of this wonderfully preserved Mountain Temple, and the view of the surrounding mountains.
Some side notes for the trip:
The train station does have lockers if you are looking to store bags during your visit to Yamadara.
There was no English speakers around when I was there, so if you are not great at Japanese yet bring Google Translate, or a dictionary. But don't let this stop you from visiting! Everyone was more than helpful even though the language barrier was difficult.
So get to it, go on that journey, and experience rural Japan!