Early on in Fallout 4, you discover that you can have companions who can accompany and fight alongside you. There are many options to choose from, more so if you have the DLCs. However, some of them are actually better than others, and each has perks that can complement your playstyle.
1. John Hancock
Hancock is among the early companions you'll meet in the game aside from Dogmeat and Preston Garvey. You'll find him in Goodneighbor as he serves as the mayor. You'll find out soon enough that he's a bit too fond of chems.
This can be an advantage to you if you use chems for boosts a lot. Not only will Hancock judge you for using chems, he will actually like it. Plus, you'll get chems from him every now and then as a gift. One downside is that he only has 185 hit points, so he goes down easy in higher levels.
Maximum affinity perk: Isoped
2. Nick Valentine
It's hard to miss the synth detective since you will meet him sooner or later as he is integral to the main quest. You'll have to rescue him first to unlock him as a companion, and you'll be fighting through a lot of Triggermen to get to him.
He's a well-mannered synth, which means he won't like it when you choose bad dialogue options or decisions. Valentine is the best companion if you hate hacking terminals. He can open them most of the time, but the more difficult it is, the longer he takes.
Maximum affinity perk: Close to Metal
3. Cait
Between her Irish accent to her rough dialogue, you'll find that Cait is an interesting companion to have around. She had a rough life, and one of the ways she managed to get around was by learning how to pick locks.
With that said, she is among the best companions to have around if you don't like picking locks yourself. She does have difficulties with Master and Expert locks. Also, you won't have problems with Cait when you choose an immoral playthrough since she won't judge you at all.
Maximum affinity perk: Trigger Rush
4. Codsworth
Codsworth, your Mister Handy robot from before the bombs fell, is among the best early companions you can have. You won't have to do anything to unlock him other than to head to Sanctuary Hills and talk to him. He will be right outside your old house.
He is the best companion to have when you tend to fight in close quarters, meaning close-range or melee weapons, as he can deal fire damage using his flamethrower to several enemies. He also gives you Purified Water from time to time.
Maximum affinity perk: Robot Sympathy
5. Curie
You will be able to find Curie by heading to Vault 81 and starting the Hole in the Wall quest, but you won't unlock her until you finish it. She will first be a white MIster Handy, but will later on request to become a synth once you reach a certain level of affinity.
She already has 440 hit points as a robot, and it increases to 670 once she becomes a synth, so she's arguably the best companion as she can take a lot of damage. She will also give you Stimpaks occasionally.
Maximum affinity perk: Combat Medic