how do I attach 2 wires to one terminal screw on an outlet or light switch?
Certain wires must be pigtailed, you can't rely on the device to make the connection.  That includes all grounds.  It also includes neutrals in multi-wire branch circuits. 

If it has 2 screw terminals obviously ganged together, you can use those.  These are often connected by "tabs" which can be broken off to change the device's function -- watch out for those. 

It is illegal to put 2 wires on one screw. 

If it has the higher quality back connection which is clamped by the screw, those commonly provide for 2 wires per screw, so you're all set.  

If it has 2 backstab holes obviously together, well... try to avoid using "backstabs" at all as they are not reliable. 

It is illegal to use one screw and one backstab.  Use only one kind of fastening method. 

If all else fails, obtain a "wire nut" - similar to the ones you may see on the neutral and ground wire.  Nut the 2 wires together with a third wire about 6" long.  This is called a "pigtail".