You can use a circuit like this one:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/dB2Ly.png)
Choose the transistors in such way that Q1 VCE will drop 0.7V when collector current is 500mA. This will trigger Q2 to shutoff Q1.To reset the circuit just remove the source and connect it again.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/eOCeg.png)
For a more precise current limit, independent of transistor gain, you can use the circuit below. Rsense is calculated as 0.4V / current. In your case 0.4V / 0.5A = 0.8ohm. However, you will need RB to be such that it draws 50mA, or more, as the circuit will be triggered when VCE is 0.3V and not 0.7V.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/wqgGH.png)
I have done some spice tests and here are the results when I vary the resistance of the load to show how the current varies and when Q1 shuts off.
Here is the chart of Q1 current:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/0NjbC.png)
You have to read the x-axis from 100ohm to 10ohm. And here is the spice code:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/1tNRb.png)
The way the circuit works is the following:
It uses the pass transistor (Q1) Collector to Emitter voltage (VCE) drop to trigger Q2.
When Q1 VCE is high enough (around 0.7 volts) it will make Q2 conduct.
When Q2 conducts because its base is 0.7V or higher, its VCE will lower Q1 Base to Emitter voltage below 0.7V, so Q1 base will not conduct anymore and it will shut off.
The trick here is that both transistors need to be driven in a such way that their collector to emitter voltage (VCE) is below the threshold of conduction of the base to emitter of the other transistor.
When Q1 is conducting, its collector to emitter (VCE) is below 0.7V so Q2 is off.
When Q1 VCE reaches 0.7V or higher, it triggers Q2 to conduct.
When Q2 conducts, it shuts off Q1. Detail, when Q2 is conducting, its VCE needs to be below 0.7V to keep Q1 off.
I have only done this circuit with BC557 which only draws a maximum of 100mA. So, I decided to do it with the BC327 and here are the results:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/CSBAQ.jpg)
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/qKvug.jpg)
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/4rfBT.jpg)
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/KTFe3.jpg)
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/3sNKT.jpg)
I have used an LED and 1K resistor to indicate when the circuit was ON.
The 0.4A current was when ON, and the 0.05A when it was OFF. The 0.05A is the current on Q2 when the circuit if OFF.