These are some visualizations I made to help understand the intersection of a ray with an axis aligned bounding box — the slab method.

TL;DR:

2D demo here

3D demo here

Algorithm:

Resources: