Dignity is honorableness, a quality of the person being elevated. Respect is a viewpoint, a quality of the person doing the elevating.
In your example context, there is considerable overlap of connotation, and one could be used in place of the other. In other contexts, it would be hard to do so. For example, we can refer to the dignity (honorableness) of an action, but can’t meaningfully substitute respect. And we can refer to things differing in some respect (from some viewpoint), but can’t meaningfully substitute dignity.
Dignity identifies a worthy, high, and honorable condition. When person A treats person B with dignity, it means person A acknowledges person B’s dignity (worth or value). This is also seen in the verb dignify: if I say “I refuse to dignify that with an answer”, I mean I refuse to treat the question as worth answering: it’s not me, but the question itself that lacks dignity.¹
Respect identifies the act of paying attention or proper consideration, and by extension the act of viewing someone as worthy of such consideration. When person A treats person B with respect, it means person A takes proper notice of person B, according person B due care and honor. This is also seen in the verb to respect: if I say “I refuse to respect that decision”, I mean I refuse to treat the decision as worthy of respect: it’s me, not the decision, that lacks respect.²
It is helpful to look at the etymology of these words, because their meanings reflect their history. Dignity comes from the Latin noun dignus, “worth”, and is related to other valuing words such as dignitary, dainty, deign, disdain, and indignation.³ Respect comes from the Latin verb respicere, literally “look back at”, and is related to other viewing words such as spectator, spectacles, and inspect.⁴
Best Answer
In colloquial English usage, "get the best of" means to beat whilst in competition, to win to achieve dominance or superiority in some regard - "we played table tennis, and I got the best of him two out of three matches", and is sometimes shortened to "bested": "we raced, running hard, and he bested me".
However "to get the best out of" is used to mean you found a method to get the most effort/work/efficacy out of a given person, item or event: "Her teacher was brilliant: with careful planning, despite her detesting the topic, he got the best out of her and she took first marks as a result" or "we raced, my son and I, and by running neck and neck, dropping back and surging forward, I got the best out of him; he ran as though world's ruin was at his heels".
So in your case, the only appropriate phrase of the two presented is "get the best out of", but be aware that it connotes that there are special techniques, tricks, or not readily apparent ways to accomplish the tasks at hand.
Hope this helps.