When preparing for travel, I always go to the bank to get a collection of $5 and $1 bills since I only carry plastic normally. When I know I'll be interacting with service positions, I'll take out the cash in advance to have it in a separate pocket. I do this when I'm travelling to the hotel, waiting in line somewhere, in the elevator, etc. as long as I'm not directly being watched by the person I'll be tipping.
After they perform their service, they'll almost always ask "is there anything else I can do for you?" or something similar, which has a dual purpose as a social signal that they are pausing for you to give them a tip. I'll make some quick small talk ("best place for pizza/steak/whatever?" or "where's the pool?"), thank them for their help while extending my dominant hand for a handshake and handing them folded bills (usually folded twice into a thin rectangle) with my other hand with the bills sticking about 3/4 of the way out so they can easily take it.
If your interaction is very brief (valet opening the car door upon departure) then simply handing the cash in the same manner as above while saying "thank you" is appropriate. You can also try 'palming' the cash by placing it inside your hand while extending it for a handshake, but this works better in the movies as it's prone to fall out, not be taken, or otherwise fail. I once tried to be slick and slide cash into the breast pocket of a porter's shirt, but they were clearly uncomfortable and I now believe that's another movies-only maneuver.
Edited note: If you aren't as nervous about social situations as I am and won't think about preparing your tips in advance, it should be just as acceptable to quickly pull out your wallet while making some short conversation and simply hand the cash over while thanking them. I don't know why, but folding the bills at least once if not twice along the long edge (cutting the length in half) makes it easier/more acceptable to give a tip. If you don't mind rounding up, you could also just keep a few $5 or $10s in your pocket (all the same denomination) so you can more easily pull out the right quantity and pass it over without having to pull out an entire wallet or count out bills. Just don't ask for change.