Do the prepositions have different meanings? I don't exactly know their meanings. Let me know the meanings if you have the time. Please help me.
The preposition with has some basic meaning of association or accompaniment, but it is a versatile word: the OED records forty separate senses (some of which are obsolete). It can signify conflict, as in
I argued with you
or it can express an amicable exchange, as in
I traded pleasantries with you.
The preposition to is just as flexible as with, finding basic meanings in movement towards or proximity in time and space:
At ten to six, I ran to you so I could stand next to you.
But it has many uses in expressing association:
If I'm not your cousin, what is my relationship to you?
Notice that this is a genealogical usage, but in a more general sense, I could also say
I have a good relationship with you.
These words come to us from Old English. The OED traces their uses back over one thousand years, giving them a complicated semantic history. Thus which one to use when is a matter of idiomatic context and cannot be determined without that context. There are no simple definitions that will encompass their entire meaning and no simple rules to tell you which to use.
The short answer is, "it depends". And what it depends upon is largely context. It is possible that "with you" and "to you' mean the same thing, but also that they could mean different things -- the verb in each case is probably going to govern how they are understood.
In the case of the verb "To Do":
- What can I do to you?
- What can I do with you?
In the first case, I am going to act upon you, possibly without your consent and probably in a negative sense. In the second, it is possibly without your consent, but the action is more ambiguous. It might be good, it might be bad, but the sentence alone doesn't make this clear.
The verb "To Talk":
- I will talk to you.
- I will talk with you.
In the first case I am going to speak to you and I'm not necessarily going to listen to your response, but I might, and the implication is that this will be a monolog or a speech. In the second, it implies that we will have a conversation or a dialog.
The problem is, so much is determined by context and the verb used with the preposition that it is impractical for us to give you an exhaustive answer.
You might have better luck on the English Language Learners stack exchange, or read the definitions of "with" and "to" in an English language dictionary.