Visitors from most countries of West Europe and North America do not require a visa to enter Ireland, and nationals of the UK (including Northern Ireland) do not even need a passport to enter the country. For everybody else, visas are essential. You can get a visa issued either from the Irish embassy in your country, or by applying to the Visa Office, Department of Foreign Affairs, in Dublin. You’ll have to present your visa at the immigration desk when you arrive in Ireland, and only then will you be given a permit to enter and stay in the country.
Remember to allow a minimum of three weeks for a visa to be processed; more if you’re applying through post. Once you’re in the country, if you stay more than three months, you’ll need to register with the local police.
EU citizens are allowed to live and work in Northern Ireland without a visa. Citizens of the US, Canada and Australia and New Zealand are allowed to stay in Northern Ireland for 6 months without a visa just like in the rest of UK. All visitors must have a passport though, issued by the governments of their own country. Visitors from countries other than the ones specified above must have visas for entry to the UK. The same rules as in the UK apply to Northern Ireland.