Frederikshavn is the end of the railway from Aalborg and Copenhagen — direct InterCity trains run about every two hours from Copenhagen (about 5 hours) and hourly from Aalborg (about 1 hour). The station is right at the harbour, so connecting to ferries is a short walk.
The town is the main Danish ferry port for Sweden and Norway: Stena Line runs to Gothenburg (3 hours), and Fjord Line to Oslo and Larvik. The closest airport is Aalborg, about 70 km south. There is no commercial flying into Frederikshavn itself.