Oooh good stuff there. Thank you. I would imagine the dark thing is probably coming into play, as is the range cast in mele range. If I get locked up I am afraid to run away cause it gives a free attack so I just stand still and cast. Appreciate the feedback. I have played about 2 10 hour playthroughs and I could literally make a a thread where I unload questions. There is a lot to this game and its mechanics and I have just scratched the surface.
No problem.
Here is the thing too, Warlock doesn't have a melee Range cantrip that I am aware of (Chill Touch despite it's deceptive name is a range spell). So you need to either move away (which may provoke an opportunity attack) or use a melee attack OR if you have Misty Step you can get away using that or an invisibility potion or spell.
If any enemy is within 5 feet of you then they "threaten" you and will cause your ranged spells to have disadvantage against any target unless you can get away from them.
This is actually a great tactic for your melee characters to use against Archers and Ranged Spellcasters.
As for the darkvision thing, if the race you play doesn't have darkvision then you can choose it as one of your Invocations - it's called Devil's Sight and it gives you Darkvision to 120 feet.
GL!