>>96319464 (OP)
Assuming 5e:
Level 1 - fighter as your class, crossbow as your weapon, archery as your fighting style, any race with a dex bonus
Level 3 - any non-retarded subclass. I suggest battlemaster with menacing attack.
Level 4 - crossbow master feat
Level 6 - sharpshooter feat
From there on just focus on maxing dex. You can multiclass into rogue too if you want.
Enjoy dealing absolutely stupid fucking damage until you inevitably get outscaled by some fuckass spellcaster towards the end of the campaign.