While the macaroni is still warm, toss it with a bit of oil or vinegar to prevent sticking, then add mayonnaise while the pasta is slightly warm.