How to holster your weapon and surrender in Starfield

Stop! You’ve violated the law!
In Starfield, you may accidentally start a firefight with authorities, but you can end it preemptively by holstering your weapon, as long as your bounty isn’t too high.
If you’ve committed a small crime like stealing, authorities will approach you and start the arrest prompt automatically. You don’t need to holster your weapon to get this prompt.
How to holster your weapon and surrender
On PC, hold down R to put down your weapon. On Xbox, hold down X. After you’ve done this, you should be approached by a nearby officer, and they’ll start the usual arrest prompt. If not, you can try talking to them. This only really works if you accidentally hit somebody once, but did not kill anyone.
However, if you’ve killed an NPC, it’s over for you. You’ll need to kill the officers, be killed, or reload a save. We tested this on New Atlantis and there was no way to get out of the situation that we could find, as we couldn’t even make it back to our ship, since people were attacking us. If your bounty gets this high with, say, the United Colonies, you’ll get attacked on sight when you re-enter United Colonies territory — whether you’re in space or on land — and are spotted.
Once the authorities talk to you, they’ll give you the usual options between paying a bounty, serving time, or fighting. Obviously since you’re surrendering, you should not take the last option.