The target is chosen just after any creatures dealt lethal damage at the same time that the enchanted creature dealt damage have been put into the graveyard. That might include the enchanted creature itself, if it had trample and was blocked, for example.
Random a card of Magic: The Gathering (MTG), but you can also roll the D20 dice, random a Planeswalker, have fun with the random rules and more.