Use the control button when there are friendly NPCs around, to target the nearest hostile NPC to your cursor.
Place a container in your inventory, open it and drag and drop items into it. That is not considered stealing, but the first time you remove the items is, so make sure you are alone when you do so.
Save before attempting to steal, etc.
Do you have an invitation to the castle already? Commander Ralph is involved in several quests, so if you have a recent save, I would suggest re-loading.