There were three parts of the Alien and Sedition Acts:
The Federalists used the acts for their own good. Most of the new people who came to the US became Democratic-Republicans, and by making the residency requirement longer, fewer immigrants would become citizens and vote against the Federalists. If the President could deport any alien from an enemy country or any alien who was considered "dangerous", potential Democratic-Republicans could never vote. With the Sedition Act, criticizing the Federalist government was illegal and could get you into jail. The Federalists hoped that this would stop the Democratic-Republicans from speaking out against the government, but the act did not really work. There was a lot of opposition from the Democratic-Republicans, and they wrote about it in the media anyway.
The acts backfired against the Federalists. John Adams did not support the acts and never used them. Only one alien was actually deported and ten people were convicted of sedition. All of the acts were repealed or expired by 1802. They were part of the reason that the Federalists were not elected again in the election of 1800: the people did not want more laws against their First Amendment rights.