Arduino Uno not running properly when powered via USB on Laptop

Please read the posts at the top of this forum section as they outline details you have not included.

That you can upload is a good sign.
Your best bet is to include a schematic of what is connected and how.
Even a hand drawn one may suffice.

Bob.