Minecraft wiki entry for Nether_survival, associated text: Let the piglins kill it.
Use warped fungi to scare them, and hit them as they are retreating and don't attack you.
Burn them with fire or lava.
Dig a 1-wide hole on the nearby wall and hit them from inside.
Sprint/critical hit them.
Spam click to knock them back while damaging them.
Build a 4 block pillar to kill the hoglins with a ranged weapon, or dump lava on them.
More risky, build 3 blocks up and crouch to melee attack them. However, Hoglins can still occasionally get you from this height and knock you off the pillar. If you are not on a flat area, they can get up on another block enabling them to hit you. Always examine where you are building up.
If you lack any tools or ranged weapons, it is best to avoid crimson forests and some bastion variants, if you spawned in a crimson forest, avoid hoglins, hide behind blocks or trees, hoglins do not attack you if you are not close to them, or if you are not in their line of sight. If a hoglin does spot you run to a group of piglins, as piglins are known to kill hoglins, hiding or getting to a high area is also a good idea, as hoglins have a hard time of reaching these areas. Placing down a warped fungus can scare hoglins away, as well as luring them into lava lakes and ruined portals.