Object or Complement
The professor wants to retire.
Here 'to retire' is used as object or complement?
Also, in "The man gave Amy some good advice"
Is 'some good advice' an object or complement?
In The professor wants to retire, to retire is the verb in an Infinitive Object Complement Clause. That means that it is a clause, with an infinitive verb, that functions as the Direct Object of the verb wants.
Complement clauses are noun clauses that can be either subjects or objects; there are four kinds in English: infinitives, gerunds, embedded questions, or tensed That-clauses. This is the only way I ever use the term.
Other than this use, complement is a term that is used with a wide variety of meanings. Since most of these meanings add no more information than "something that completes a phrase or clause", they're mostly unhelpful and are best avoided.
The subject of the complement clause is deleted because it's identical with the subject of want (The professor), and want is a verb that governs A-Equi.
Complement is used to describe ‘a phrase or clause that completes the meaning required by some other form’ (Longman Student Grammar of Spoken and Written English), bearing in mind that a phrase can consist of one word. To that extent, to retire and some good advice in your examples are complements. However, it would be usual to describe them more precisely as direct objects. They can be both a noun phrase, as in some good advice, and a clause, as in to retire.