Holding the CTRL key down will prevent your character from moving when left clicking and thus make it safer to select, shoot at, or cast spells on enemies. You can change the CTRL key to work as a toggle instead in the game options, if that is easier for you.