First off get a visitor LEAP card, you can get one at the airport, it's a handy way to use public transport in and around Dublin, it's similar to Oyster, just tap and go.
Leap Visitor Card - Leap Card
Then do an itinerary for yourself that's not too exhausting, it's easy to wear yourself out and not have the energy for a few scoops (drinks) at night! Please avoid Temple Bar, Dublin people wouldn't be caught dead there. It's nice for a stroll around, but avoid the pubs unless you want to take out another mortgage.
You have four days, so depending on time of arrival day one, stroll around the city or take the open top bus. Great for orienting yourself and you can go back to places that interest you.
Second day, as others have said - take the DART train to either Howth or Malahide (or both!) they are charming seaside towns North of the city. Or you could take the DART outwards all the way to Greystones which is Southwards, it's a lovely journey all along the coast so sit on the left out and right coming back towards the city. On the way back stop at Dalkey for a walk around and a pint in Finnegans, you might see Bono who lives up the road, if he's not on holidays, it's one of his local pubs.
Then day three you can go to the places that interest you like museums galleries, and all that, plenty of them and they are free to enter. Then go shopping. Grafton Street and the St. Stephen's Green Centre are good, but the best REAL Dublin shopping is in Henry Street, that's where the genuine Dubs go!
I was born in Dublin, and am getting very nostalgic now. Will be back there soon enough though. Hope you have a lovely time and stay safe, don't be complacent out and about, it's a big city and the usual safety rules apply. South of the river is very pleasant, Northside not so much (apart from the shopping!), so take care.