Usually you'll be asked what you can do. Be frank and don't oversell your skills. If you were invited aboard without being asked about your sailing skills, you probably won't be expected to do anything too complicated.
Stay out of the cockpit during the race, unless you're assigned to work there. Don't engage in unnecessary talk with other crew during the race. The helmsman is thinking about a gazillion things, and needs to concentrate completely. The tactician needs to concentrate on tactics, the Foredeck crew needs to plan what he's going to do on the next leg of the course.
Watch and learn. If someone yells "foot
cleat" or "butt
cleat," move your butt or your feet, in case you're the one who's fouling a
line. After it's over, help the crew fold or flake the sails and put the boat away. Stay out of the way, contribute what you can, and enjoy the race.