Ruling on marrying cousins
Al-hamdu lillah (All praise be to Allah). There is no objection whatsoever in the Islamic religion for a man to marry any of his relatives except al-maharim (those forbidden for marriage) whom Allah mentioned in surat al-nisaa', 4:23 (interpretation of the meaning):
Prohibited to you (for marriage) are: your mothers, daughters, sisters; father's sisters, mother's sisters; brother's daughters, sister's daughters; foster-mothers (who breast-fed you), foster-sisters (who breast-fed from the same woman as you); your wives' mothers; your step-daughters under your guardianship, born of your wives with whom you have consummated marriage, no prohibition if ye have not consummated; (those who have been) wives of your sons proceeding from your loins; and two sisters in wedlock at one and the same time, except for what is past; for Allah is Oft-Forgiving, Most Merciful.
Thus, when Allah mentioned for us the relatives to whom marriage is forbidden, we then come to know that there is no objection for the remainder of the family relations. Furthermore, there is no condition that it be the last resort as indicated in the question. Among the most prominent evidence of this fact is that the Prophet (peace be upon him) married his daughter Fatima to Ali (may Allah be pleased with them) and he is the son of her father's uncle, as well as the marriage of the Prophet himself to Zainab bint Jahsh (may Allah be please with her) and she is his aunt's daughter (i.e. his cousin); and there are many other such examples.
However, a different question may be asked, namely: "Is it better or preferable for a Muslim to marry someone he is not related to rather than a relative?"
The answer to this question varies from case to case, and perhaps it may be preferable to marry people who are non-relations, for example if one aspires to form new social ties or bonds, and regards the existence of a marriage relationship with a different family as constructive in widening the circle of social bonds.