The easiest way would be to travel by plane, possibly with a direct flight to Dubrovnik or through Zagreb. Another way is to take the train to Rijeka and from there a ferry to Dubrovnik. The ferry takes quite some time but it could be a pleasant way to see the coastline of Croatia.