The O is a secondary part of the sentence which completes or restricts the meaning of a verb or sometimes an adjective, a word denoting state, or a noun. It can be expressed by:
1) A noun in the common case (I'll give her a present);
2) A pronoun (personal in the objective case, possessive, defining, reflexive, demonstrative, indefinite) (I know everything), the pronoun "it" sometimes is used as a real (notional) object, but occasionally it's a formal introductory object following such verbs as "to think, to find, to consider, to make, etc." (He remembered it; He found it impossible to forget that day);
3) A substantivized adjective or participle (She helps the poor);
4) An infinitive, an infinitive phrase or construction (He ordered them to stop);
5) A gerund, a gerundial phrase or construction (They forbid shouting in the streets);
6) Any part of speech used as a quotation (He said "Wow" seeing this);
7) A prepositional phrase with a noun or a gerund (I don't mind to your going with us);
8) A syntactically indivisible group (He found a number of cars parked).
There are 3 kinds of O: the direct object, the indirect object, and the cognate object.
The DO is used after transitive verbs with which it's closely connected as it denotes a person or thing directly affected by the action of the verb, it's used without a preposition (He moved his body). A TV takes only one object expressed by a noun or pronoun without any preposition, though there are a few verbs in English ("to ask, to teach, to forgive, etc.") that can have two direct objects (She taught me Spanish).
The IO denotes a living being to whom the action of the verb is directed. Type 1 of IO expresses the addressee of the action (She gave me a book). It's used with TV which can take a DO, so it hardly ever stands alone (and comes before the DO, otherwise the prepositions "to, for" are used) (Give it to me). Type 2 of IO (or the prepositional IO) is mostly used with IV and any preposition (I am certain about it).