Pulled out from red light. Heard motor revving and realized that car was not moving. Put into park and then shifted back into drive. Car then drove normally.
You didn’t give us much to go on but… I’d guess you may have bumped the shifter into neutral at the stoplight. When you put in Park and back to drive, you solved that issue. It may be a fluke or it may be that the shifter is slightly out of adjustment.
Keep that thought in mind if it happens again. Maybe consider having a mechanic look at it.