I need the clarification of these two particular instances.
Do this to your computer when you finish using it.
Do this with information that you don't want to keep on your computer.
What rule am I to use in order to choose the right preposition?
The object of to in your example is a thing directly acted-upon. You turn the computer off. But to has many other semantic functions.
The object of with in your example is a thing involved in the action you take. You throw the information away. You put it in the trashcan. Ditto for with : it has many semantic functions too.
Oh no. What did you do to the cat?
-- I painted it blue.How did you erase the chalkboard? It's so nice and black.
-- I erased it with a felt eraser and then wiped it with a damp cloth.What shall we do with the cat now that you have painted it blue?
That last question: what action shall we take involving the cat or respecting the cat or vis-à-vis the cat?† We are not going to do anything directly to the cat, but we are going to take some action in which it will participate or be involved:
We will give the cat away.
The cat has not been changed intrinsically. Nothing has been done to it by giving it away.
† Thinking on the etymology of respect and regard in the context of with and vis-à-vis will give you insights into the semantics of the pronoun.
English prepositions
on a well-known online bookstore.@
character to ping a user, eg.@Em.
Also, please ask one question (about one problem) per post. And please edit your post to make clarifications. Remember to include details about your confusion or concern so that visitors and answerers can have a clear idea of your problem. See Details, Please and the Contributor's Guide (Asking) for tips and examples.