Roskilde is 25 minutes from Copenhagen Central Station by frequent regional train — trains run several times an hour throughout the day. It's an easy half-day or full-day trip from the capital, and the train arrives right in the centre of town. The Viking Ship Museum is about a 15-minute walk from the station, and the cathedral is even closer.
There is no reason to drive unless you are continuing west into Jutland.