When you select a word, it will tell you how many letters in that word line up with the correct word. The hacking minigame is essentially a process of elimination.
One of the words will be the correct password. You will see a list of words with random characters in between. Once you find a terminal that is locked, you will have to activate it to initiate the hacking minigame. Rank 4 will give you unlimited hacking attempts although, as you’ll see below, I do not think this rank is necessary. Rank 3, which becomes available at level 21, will grant you access to Master terminals. At level 9, you will be able to move to rank 2 and hack expert terminals. Rank 1, which can be accessed at any level, allows you to hack advanced locks. To unlock access to the more complicated terminals, you will need an intelligence of at least 4. You can hack Novice terminals right from the start of the game.
There are 4 difficulty levels of hacking in Fallout 4 which are Novice, Advanced, Expert, and Master. This skill can be used to open doors, gain access to stashes, control enemy defense systems, and much more Hacking, along with lockpicking, is a great way to take advantage of the world in Fallout 4.