Choose target spell or permanent that's red or green. Its owner puts it on the top or bottom of their library.
If a spell is put into its owner’s library, it’s removed from the stack and thus will not resolve. The spell isn’t countered; it no longer exists. This works against a spell that can’t be countered.
The owner of the target spell or permanent chooses to put it either on the top or bottom of their library.