I know they used a lot of mechanics back then, but were R2D2 and C3PO mechanical, a costume, or something else?
For c-3po, it was a costume, Anthony Daniels played c-3po:
For R2-D2, It was a costume and a remote controlled robot. CGI was also used in the prequel trilogy. So, they had Kenny Baker to play him :
Baker performed the role of R2-D2 inside a standing unit of the droid, wearing a specially-made suit and manipulating the droid's lights and appendages, turning his head, rocking his body back and forth, and moving his eye with a rod. In addition to Baker's unit, every Star Wars film has made use of a number of remote control units, as Baker's was largely immobile.
A computer-generated R2-D2 was also used in many scenes of the prequel trilogy, including a scene in Episode II where the character walks up a staircase. Baker has stated that he would never have been able to do that in his costume.