Like MBraedley says in their answer, you want to start by optimizing your Kerbin-to-Jool transfer. With a proper Hohmann transfer, you should encounter Jool right at the apoapsis of your transfer orbit, where your spacecraft will be moving in the same direction as Jool around the Sun, but slower, with Jool effectively catching up with you from behind.
Next you should fine-tune your transfer orbit so that you'll be coming in over one of Jool's poles. This should put your Jool periapsis (which you'll want to get as low as possible without dipping into Jool's atmosphere) at about a 45° angle to the ecliptic.
The next thing to do is to put a maneuver node right at your Jool periapsis and plan a prograde burn there. Since you'll be burning at 45° to the plane of Jool's orbit (and of the solar system in general), you will be simultaneously slowing your equatorial velocity relative to the Sun and increasing your polar velocity, both of which you want. And since you'll be doing the burn way deep in Jool's gravity well, you get to take maximum advantage of the Oberth effect.
Ideally, you should adjust your periapsis burn so that you'll end up leaving Jool's SOI straight up (or down, as it might be) out of the ecliptic. Your solar polar orbit probably will not be circular, but if you're just trying to replicate the Ulysses mission, that may be fine. You can always adjust the orbit with additional burns at solar apo/periapsis if you need to.
(Ps. As a disclaimer, I should note that I haven't actually tested this maneuver in KSP yet. I believe it should work, based on what I know of orbital mechanics and my experience with the game, but I'm quite aware that saying that something should be doable and actually doing it are very different things. I'll try to run a test mission later and maybe post some screenshots, but that'll probably have to wait until I'm on another computer that isn't quite as slow as this ancient laptop.)