DI stands for direction influence and basically lets you slightly affect how/what direction you are flung when hit by an attack, here's a quick synopsis or w/e on DI in case you don't wanna read pages of stuff
Trajectory DI or just DI:
Occurs on the frame just after hitlag*, or the first frame of knockback. Influences trajectory you can fly. Perfect DI is holding the control stick at 90 degrees from the move's base trajectory, which results in an 18 degree change from the base knockback trajectory in the direction that you hold the stick. Surviving kill moves off the side requires up+toward the stage, or just up for low angle moves, sideways for moves that kill off the top, and towards the stage for meteors/spikes. For combos, this depends heavily on a character's vertical and horizontal follow-up ability, but in general you want to get back down to the ground ASAP so you'd DI down and away for anything that doesn't send straight up, or sideways for things that do.
Smash-DI or SDI
Occurs during hitlag frames. Influences character position during hitlag. Perfect SDI is smash inputs on the control stick every frame (or every other frame, not sure, but it's not important unless you're making TAS stuff). Of course, this isn't humanly possible, but what IS is rolling the control stick during hitlag to quickly input multiple SDI inputs in the general direction you want. Where you would WANT to SDI should be pretty obvious- away from blastzones against kill moves, and away from opponent during combos. SDIing towards the wall or ledge is how you make yourself collide with it when hit during a low recovery in order to edge tech. This can't be used to collide with the ground directly but can put you in a position to use regular DI/ASDI to do so. You can't SDI down when hit while grounded (you're already as low as you can go) and moves that send horizontally or lower can't be SDI'd up when hit while grounded.
Automatic Smash-DI or ASDI
Occurs only the frame just after hitlag, same as DI. Influences character position on that frame. Can be done by just holding control stick or c-stick (which is prioritized for ASDI over control stick) allowing Trajectory DI input to be separated from ASDI input. This allows for perfect** ASDI and perfect* DI to both be done on the same hit, called Double-stick DI, or DSDI. ASDI can be used to collide with any surface, whereas SDI can't collide with floors; this is what allows pseudo-crouch canceling.
*Hitlag is also called freeze frames, it's the brief moment where both characters pause when one of them lands a hit, it's how you know you hit them besides the graphical effects and SFX usually, because the move slows down just a tad
**perfect is only used to refer to "going where you want to go as well as you can"; often times DSDI is used to collide with floors from strong attacks, meaning the perfect DI might be down and away while the perfect ASDI is down. "Perfect" will always depend on the goal, however.
If I'm wrong on this **** somebody please call me out, but I'm fairly certain I'm not