According to the U.S. Constitution, the responsibility of selecting federal judges belongs to the president. However, any federal judge that the president wishes to appoint must first be confirmed by the U.S. Senate.
There are hundreds of federal judges at various levels of the court system, and while each federal judge serves a life term, a president is responsible for many appointments during his time in office. To make all of these appointments, a president gets a great deal of help from the Department of Justice, members of Congress, the FBI, current judges and the American Bar Association. It's also common for prospective judges to nominate themselves to an open position.
Senatorial courtesy is also regularly employed. This occurs when the Senator from the state where there is an opening makes a recommendation to the president. The Senator making the recommendation is usually from the same political party as the president, who almost always nominates the person suggested by the Senator. The judge nominated usually has similar political beliefs and belongs to the same party as the president. However, if a president chooses someone based on a personal relationship or someone who is unqualified to be a federal judge, it may be difficult to get confirmation from the Senate.