Help finding out which side of a cube a raycast hits

I’m making a voxel based game, and I’m trying to make placing blocks act similar to minecraft in the sense that the voxel is created adjacent to the side of a preexisting voxel that the player clicks. I successfully did this part by comparing the origin of the 1 meter cube and checking which direction it was 0.5 meters away from. The catch is that I need to get this to work if the cube is at any rotation. If I use RaycastHit.point, those number are less valuable without taking the rotation into account and I’m really unsure of how to go about doing that. I’m using c#

Any advice would be great.

I believe this is what you are looking for. Or something like that.

 var newBlockPostion = hit.transform.position + hit.normal;
 var newBlockRotation = hit.transform.rotation;