Arif made an aggressive 57 off 51 balls and Taha showed lot of grit at No. 3 to score 51 off 105 deliveries on a greenish wicket that lured Sri Lanka captain Kusal Mendis to bowl first after winning the toss.
Captain Babar Azam's flamboyant 50 off 58 balls and Saud Shakeel's unbeaten 57 added to Pakistan's solid start before bad light stopped play with 67.2 overs possible on Monday's first day of the two-Test series.
Sri Lanka recovered well after Pakistan's sizzling start of 2-137 in the 30-over first session and took three wickets as the four pacers bowled to more disciplined lines after being dominated by Arif's early aggression.
"There were 63 balls that beat the bat today," said Sri Lanka bowling coach Ryan van Niekerk. "When you look at the bigger picture Pakistan slightly ahead, but we're also short of a little bit of luck."
Tayyab, 20, was fast-tracked to Test cricket after an impressive domestic season and showed early aggression as Pakistan raced to 0-86 in 16 overs.
Sri Lanka struck back removing both Tayyab and opening partner Azan Awais (30) in successive overs. Both were caught behind, off Milan Rathnayake and Asitha Fernando (2-64) respectively.
Babar, who hasn't scored a Test hundred since December 2022, looked at ease against pace, playing his trademark cover drives, that included three off Dilshan Madushanka's first over after lunch as he completed his 35th Test half century.
However, he was undone in the leftarmer's next over when he gave Mendis the third of four catches in the day.
Taha and Shakeel then dug in to share a 68-run stand before Sri Lanka picked up two wickets in the final session.
Taha tried to slog sweep part-time spinner Sonal Dinusha but top-edged to Dhananjaya de Silva and Salman Ali Agha (16) edged Fernando.
"My only regret is that I should have batted longer after getting set," said 26-year-old Taha. "Babar and coach Mike Hesson motivated me a lot. Obviously, there was pressure and some nervousness early on, but luckily, I batted with Babar bhai (brother) and he helped me."
Pakistan also awarded debuts to Arafat Minhas, a spinning allrounder, and fast bowler Saqib Khan.