You get one free "interact with an object" during your turn. This is not considered an action and doesn't cost you anything. The examples given are opening a door or drawing a weapon. However, the DM may rule that some interactions are unusually time-consuming and require you to use your action. Examples given are forcing a stuck door open, or turning a crank to lower a drawbridge.
It's up to the DM whether any given action counts as "unusually time-consuming." However, based on the examples, I would say that picking up a fallen sword should not cost an action; you can do it for free on your turn as your "interact with an object."
See page 70 of the basic rules.