Often the simplest ways is to simply get in with a password. Its amazing how people have easily guessable passwords.
If that doesn’t work, the hackers exploit mistakes by programmers. For example, forms that don’t contain code to check what someone types in. The hacker fills the form with garbage and rounds it off with commands that the computer understands.
Sometimes these commands ask it to download software to their servers, the hackers can then use this software to access more of their systems.
When programmers find these security holes, they often update their software with ‘patches’ that means the hackers can no longer get in. That’s why it’s always important to keep your software up to date.