Say you're a 5th level fighter. You take the regular Attack action on your turn and attack once. Can you then ready your other attack to grapple, instead of attacking on this turn, in case the enemy tries to get away? (Just like if you used one attack to grapple, then the other to shove.)
This does not work
In order to ready an action, you have to use your entire Action to take the special "Ready Action" option. But in order to make your first attack, you must have already used to Action to instead take the "Attack" action, which means you no longer have an action available to ready anything.
See also the types of actions you can take.
No, Ready and Attack are two different actions
If you take the Attack action on your turn, you can't also take the Ready action. From the PHB section Actions in Combat:
When you take your action on your turn, you can take one of the actions presented here, an action you gained from your class or a special feature, or an action that you improvise.
It says you take one action, and doesn't make any provision for combining multiple actions into one.
As a fighter, you could take both actions by using your Action Surge, since that gives you an additional action on your turn.