The best times to visit Sydney are autumn (March to May) and spring (September to November), when the weather is mild and sunny, the ocean is still swimmable and the crowds and prices are lower than in peak summer. Summer (December to February) is hot, humid and busy, with the huge New Year's Eve fireworks over the harbour but the highest prices and fullest beaches. Winter (June to August) is cool and can be wet but rarely cold, and is the cheapest time to visit. Whatever the season, Sydney's sun is strong, so sun protection matters year-round.
Sydney's ocean beaches, including Bondi, have powerful rip currents that pull swimmers out to sea and are the main safety risk for visitors. Always swim between the red-and-yellow flags on patrolled beaches, never swim alone or after drinking, and if caught in a rip stay calm, raise an arm and float rather than fighting the current.
Australia has some of the strongest UV in the world and you can burn quickly even on a mild or cloudy day. Wear a high-SPF sunscreen, a hat and sunglasses, seek shade in the middle of the day, and cover up on the beach and during coastal walks.
Sydney is generally very safe, but as in any big city take normal care late at night around busy nightlife areas such as Kings Cross and parts of the CBD, watch your belongings in crowds, and use licensed taxis or rideshare to get home rather than walking alone.