If you're playing an informal round of golf by yourself or with some friends, switching your ball for a different ball during a hole isn't likely to bring down the golf police on you, but if you're playing by official USGA rules, it could cost you on the scorecard. There are only a few conditions that allow changing from one ball to another between tee-off on a particular hole and holing out.
Determine that your ball meets one of the rules conditions allowing the switch of a ball during the play of a hole. The ball must have become damaged to the point of being unfit for play, or must be lost, out of bounds, in a water hazard or unrecoverable.
Show your fellow players that your ball is damaged beyond being playable if that is the case, and replace it with a similar ball to continue play.
Make a drop with another ball according to the relevant rules if your ball is in a water hazard or lost.