In Unity 6 there is an inbuilt version that does this now. If you have Tilemap Collider 2D for the tiled walls, in your Shadow Caster 2D, change Casting Source to Tilemap Collider 2D
The code you put in the video doesn't work. here for example you have "isWallTouch= Physics2D.OverlapBox(wallCheck.position, new Vector2(0.3f, 8.9f)**, 0, groundLayer);" but that doesn't work, it needs a wall layermask so should be "isWallTouch= Physics2D.OverlapBox(wallCheck.position, new Vector2(0.3f, 8.9f)**, 0, wallLayer);" but you left it as groundlayer in your video which doesn't detect walls.