Replacing my 2N2222A with a high power transistor
Specs:

Input: 12V 0~0.3A
Ouput: 0 to 8V  0~0.3A
Max Case temp rise: 40'C
Speed: not important
Heatsink: 24'C/W convection +X with thermal grease, insulator

Design:

Linear Loss 4V*0.3A = 1.2W
Est: 30'C/W * 1.2W= 36'C rise.   OK
WIth   4V > Vce &lt; 12V  , the best choice for high hFE is a Darlington TO-220 with this heatsink.  

MJD122-1 $0.90 (1)  https://www.digikey.com/product-detail/en/stmicroelectronics/MJD122-1/497-16183-ND/3087726

For better linear operation with step load low overshoot, use BJT Op AMP not CMOS R2R type.  Even a lowly uA741 would work or LM324.  CMOS is prone to high step output overshoot and loads +stray capacitance stability yet C_load are reduced by hFE.

Rs = 1 Ohm means 300 mW dissipation when 100mV will do with  100mV/300mA = 1/3 Ohm or similar with 30 mW.  Then change Gain ratio as required.

R6 is redundant relative to R7.   

Accuracy depends on tolerance stack-up of all resistors.

For Short circuit protection choose 3V drop R on collector @ 400mA