Replaced a light switch and now it’s always on. Pops if you flip the switch
It appears in this box, all the whites are actually neutral.  Splice them together, fullstop.  

Now, splice the known-supply-black (hot) to one of the other blacks.  Hopefully one of two things will happen, either a lamp will light continuously, or some downline outlet that is now dead will spring back to life.  If that black wire turns a lamp on, mark it with red electrical tape, sold in 5-color packs for $4.

Now at this point all the black wires should be always-hot and all the red wire(s) should be lamps.  

Go get the instructions for your dimmer. 


identify which wire is ground (the green one, grounds are always and only green, yellow+green or bare). Unscrew the ground wire off your old switch and splice it to that wire. 
Identify which dimmer wire is always-hot/line.  Splice that to the black wires. 
Identify which dimmer wire is switched-hot or load. Splice that to the wire(s) you marked red.  A yellow or orange wire nut shoudl be about the right size,  you should own wire nuts.  


Test, button it up.  

Next time you do this...

You got into trouble for reasons. Learn them and don't do them again. 

Don't take apart more than absolutely necessary.  The actual job involved only interacting with the two wires landed on the switch backstabs, and its ground.  All that other stuff was out-of-scope for the project.  

You should have yanked the two wires out of the backstabs on the switch, (or cut them, those are pigtails, cutting pigtails is fine).  That would have given you only two wires to deal with, lots easier than six.   You would have quickly figured it out.   

The usual reason we see people do this is curiosity.   Now let's pause and think about the rationality of this.   You don't know the craft. You want to know the craft, so you want to see how things are put together.  Fair enough.  But learning electrical by dismantling your house doesn't seem very efficient, does it? It's not.  Get a book.  Go to a library and pick a 2011 or newer book on home wiring that feels accessible to you, and devour it.  Learn all about grounding electrodes and receptacle tabs and switch loops and subpanels.  Don't attempt to "learn on the internet", because Google only answers questions, and you need a well-rounded primer on the field to know which questions to ask.  In other words, Google only gives you swiss cheese knowledge: you don't know what you don't know. 

Having done so, you're ready to lurk around here and read answers and try to guess who the smart ones are.  A few answers might come out of you - we'll tell you if it's wrong.

Don't cut off in-wall wire length unless you absolutely have to.  That length is too precious to waste, as it can't ever be replaced without demolition work.  Cutting those wirenut/twists off was senseless.  You will simply be putting the white wires back as they were, and the black wires were already correct with a pigtail that you could've attached the dimmer to.  Shame, the splices were very well done. 

It's much better to untwist that wirenut or side screw, or twist-pull a wire out of a backstab... (which wrecks the backstab, but that's alright, you'll never use a backstab.) 

Of course, don't use backstabs; they have a lot of reliability problems.