Eg strawberries - 100 g is 7.7g of carbohydrates (4.9g sugar), 0.7g protein, 0.3g fat. 56% sugar.
Or oranges - 165 g without membrane or peel is 20.7g carbs (14g sugar), 1.5g protein, 0.2g fat. 63% sugar.
As opposed to, say, a snickers bar. 9.1g carbohydrates (7.6g sugar), 1.1g protein, 3.6g fat. 55% sugar.
Or a kitkat. 27.1g carbs (20.4g sugar), 2.7g protein, 10.4g fat. 50% sugar.
Granted, the fruits have way way more water content so by mass are substantially lower fractions of sugar. It can be (but is not necessarily) more satisifying to eat the increased mass and volume of fruit, or to eat the same total mass/volume but ingest substantially fewer calories (about tenfold, by mass).
But really this advice is just 'swap sweets for smaller quantities of sweets'.
https://nutritiondata.self.com/facts/fruits-and-fruit-juices...
https://nutritiondata.self.com/facts/fruits-and-fruit-juices...