The government of the United States of America is remarkably modular. While the branches of government have regulation over each other's actions, via the well known system of checks and balances, they have no authority over each other's existence. Amongst the three branches of the United States government, there is no true ordinal ranking, since they are all equal. This is in contrast to the parliamentary system used in other countries, where the executive is composed of members of the legislature, and is prone to a number of things such as no confidence votes and other esoteria.
But in the United States, there is no requirement for the legislature and the executive to have similar compositions, interests, or even be on speaking terms. The President of the United States is elected every four years, and the House and Senate have no say in the matter.
One of the few ways that they can influence the situation is the process of impeachment. However, impeachment is to be used only in cases of criminal conduct, and not because of policy differences, or even in cases of negligence, incompetence or even insanity. In other words, there is no check that any of the other branches of government have on a grossly inadequate president in the original constitution.
In 1967, the 25th Amendment to the United States Constitution was ratified. The Amendment dealt with several matters, including the appointment of a Vice-President if the office should become vacant. In another section, the 4th section, it also described a way that a President who is "unable to discharge the powers and duties of his office" may be removed from office. There was actually two instances in American history -- James Garfield and Woodrow Wilson, in which a President had been gravely injured and remained in a comatose state for some amount of time before finally expiring. While the Amendment might have been intended for such cases, there is nothing in its wording that limits it to medical cases.
In other words, as promised in the title, the 25th Amendment to the United States Constitution gives a means for a President to be removed for any perception of ineptitude. It is as close as the Constitution has of legalizing a Coup d'Etat (if such a thing weren't a contradiction in terms.)
However, the bar is raised pretty high, and it is doubtful that even in times of great political strife, it would be used for such purposes. In order for a President to be declared unable to continue in his job against his wishes, his Vice President and a majority of his "principle officers" (meaning, presumably, members of his cabinet, but who these are is defined by statute) and a two-thirds majority of both houses of congress must agree that he is unable to discharge his duties. For such a thing to be used as a judgment against a president's policies or demeanor, it would mean that the majority of his cabinet--- people he picked himself and presumably share his political views and have some personal loyalty to him --- have turned against him. It also means that 2/3rds of both houses of the legislature are not just opposed to his policies but so vehemently opposed that they would declare him "unable to continue in office". This would also suggest that not only is there an overwhelming advantage in one party in the legislatures, which is rare, but that the party overwhelmingly in power in the legislature is a different party than the party in the executive--- a quite unusual situation.
In other words, the bar for removal of a president is set so high, needing an overwhelming majority of the legislature as well as a majority of his own cabinet, that it is very doubtful that the 25th Amendment would be used for anything but the removal of a president who has obvious and immediate medical issues, rather than a president who is just deemed generally inept. However, there are many twists and turns to American politics, and there are certainly situations where this Amendment could come into play as a way of removing a president who was vastly unpopular.