Digital de-aging by ILM. They have not disclosed the exact techniques, but this article describes some of the possibilities:
From the credits, we learn that Mark Hamill did reprise his role, and Max Lloyd Jones is named as a body double ("Double for Jedi"). That signals that the filmmakers incorporated a technique similar to the one used in Rogue One, where the studio hired Guy Henry, a 56-year-old British actor (who appeared as Minister of Magic Pius Thicknesse in the two Harry Potter and the Deathly Hallows installments) to play the part of Tarkin on set before the VFX team took over to replace his head with a digital version of the late Cushing.
Hamill's face in Mandalorian could have been the result of one or more techniques, including incorporating some found footage into the shots. For instance, to create a young Leia and Luke training with lightsabers in The Rise of Skywalker, the filmmakers found footage of the actors from the production of 1983’s Return of the Jedi and combined those facial performances with digital bodies.
Other ways to de-age a performer include compositing techniques that could be likened to Photoshop or a sort of digital makeup applied to the actual actor to smooth their skin. More advanced processes could involve scanning an actor's head and creating and animating a fully CG version. This could involve hand animating based on reference material of the actor's performance and/or incorporating facial performance capture.
As regards difficulty and cost, Disney is currently banking on The Mandalorian to serve as a tentpole for a continuing Star Wars franchise, so I would not be surprised if they increased the budget for this episode. Secondly, these techniques are getting more accessible. A YouTuber has already improved the quality of the scene.
And honestly, these techniques are getting more accessible all the time. Corridor Crew has done a few very convincing digital simulations of people for example, and they've broken down how they've done it.