I am working on a science fiction story about robots and the protagonists needs to hack the main computer to stop the robots. Edit: The protagonist knows a little bit of programming but not enough to actually hack a computer so he needs to learn it.
Programming is an umbrella term, and hacking is one of its disciplines — a difficult one at that. A little programming knowledge most definitely won't let you hack anything more than your neighbor's badly-protected WiFi.
I've never done any hacking myself, but I'm fairly certain it is not something you can learn well in a day or even a week.
(Also, this may seem counterintuitive to a non-programmer, but high-level programming is in fact easier and further-removed from hacking than low-level programming. But that's beside the point.)
Until you clarify the situation in your novel, it's hard to come up with ideas, but I'll try my best.
Think of hacking into a computer a lot like breaking into a protected building: there's no one way to do it. You have to learn a wide variety of skills, like lock-picking, silent movement, good situational awareness. You'll need lots of tools, too. Similarly, there are methods and tools for hacking, but some will work on some things and and some won't. It's like solving a problem with many solutions. You don't just "learn it" any more than you learn how to break into the Pentagon by mastering lock-picking (well, so I assume).
Mr. Robot has accurate depictions. I recommend watching that for ideas.
That said, have you considered the more physical aspect of hacking? You don't need higher education to smash a computer if you've managed to locate it and get into the room. Or, better yet, you could disable or destroy the power source.
You could also introduce a pre-programmed "kill switch" — perhaps one of the people who worked on the robots was afraid of them being misused, so (s)he added an easy way to stop them. In that case, your protagonist just needs to get to that "switch". (Quotation marks because it doesn't have to actually be a switch.)
As Tau mentioned in the comments below, your character could resort to phishing. This is not technical at all, but rather a social manipulation to get inside access. For instance, sending an email to one of the employees in a company and impersonating, say, the IT security chief lets the character ask for sensitive information, like a password.
Finally, you can introduce scenes where your character had to do a bit of hacking, starting with very easy things (like breaking into a badly-protected network) and going up from there. That way, the character won't have to learn the whole thing in one go; only one small key part. (Or, rather than learn, acquire a key tool.)
I realize these are not the answers you were hoping for, but I don't know if what you want is possible, outside of your character taking a hacking bootcamp. That is, of course, a potential solution,
but not a very interesting one. You could maybe do a pretty montage in a movie, but not in a book. See the link in the first comment. Essentially, what it boils down to is: make the montage/bootcamp its own mini-arc.