Roger Federer won his opening match at the Miami Open, returning to the tournament after a two-year absence and beating the 19-year-old American qualifier Frances Tiafoe, 7-6 (2), 6-3, in Key Biscayne, Fla.