I can explain the basics how fouls works.
Personal foul is basically when you impede a player while they’re shooting. So pushing, striking or blocking their arms, chest etc. If it’s done while they’re inside the 3 point line and the person is to miss while they’re shooting, they shoot 2 free shots. If the player makes it when you foul them inside the 3 point line they only shoot one free throw and they get the 2 points from making the shot. So like when Aomine does his behind the back shot and kagami bumped him in the air and he still made the shot and shot 1 free throw after.
Now if you foul the player outside the 3 point line and they were to shoot and make it. They get 3 points plus an additional chance to shoot the free throw for 4 points.
There are also fouls called flagrant 1 and flagrant 2. Flagrant 1 fouls most of the time happen near the end of the game when the scores close. When there’s like 30 seconds left. A team will basically hug the opposing team and impede his movement. Because it’ll stop the clock and they get to shoot 2 free throws. The reason teams do this is so the opposing team can’t run down the clock and there’s always a chance they miss the 2 free shots because of pressure of the game being close.
Flagrant 2 fouls are basically unnecessary roughness. Like punching a player, throwing an elbow at their face. Basically everything that kirisaki dai did. Flagrant 2 fouls get you ejected from the game.