Acclimate for a couple of hours.
Short spined urchins aren't very sharp. Just reach into the bag and carefully scoop one into your hand. Don't squeeze down and it shouldn't feel like anything more than a hairbrush.
What kind of starfish? Many of the more colorful species will starve in all but the oldest and largest aquariums.
Probably best to avoid taking starfish out of the water at all. If you drip acclimate properly, their bag should be full of mostly tank water. Pour water out of the bag (into a bucket, not the tank, that's dirty water) until the star is just barely covered. Then place the bag in the tank, turn it inside out, and let the star crawl off.