Jemmy's answer is generally correct, I believe. But there are tricky if you think in the way English is used. E.g. Ich frage dich etwas. (I ask you something; here "you" is accusativ). But: Ich erzaehle dir etwas (I tell you something; here, "you" is dativ). Sometimes you must memorize which verb or preposition requires which type that follows.
German verbs do not always end at the end. (e.g. Ich liebe dich; I love you; the verb is not at the end). But the placement of the verb changes, depending on the type of the phase (subordinate clause (a phrase followed by "weil" for example, or if you have a modal verb, like "wollen", the main verb is placed at the end, etc.). I cannot write all the rules and examples in this space. It is best to learn these grammar step by step. And yes, the placement of verb makes it difficult to learn German but it is still possible (and sometimes fun).