First, work out a system of communication. I like 122.75. Next, work out a plan, i.e. where you will go, at what altitude. What will be your climb out, cruise, and approach speeds. Also, plan out contingencies, like aborts. EVERYTHING gets planned. No surprises.
Next, have the pilot of the number 2 ship look at the number one ship from 50 feet behind and to the side. Try and get good visual clues from the airframe To visually confirm position.
Number 1 ship mans the comms and has transponder duty. Number 2 ship flies 50 feet behind and to the side. Number 2's world is number 1. There is nothing else.
Number 1 ship flies the plan. That is, number 1 ship stays on altitude and on speed, a different way to fly if you haven't done a lot of IFR. Number 1 ship should go out and fly this way a bit. Have to stay on altitude and speed so the other guy doesn't have to chase you all over the sky.
Plans for aborts at every stage of the flight. Fly the plan. Rehearse the damn thing on the ground before you go, fly the plan.
When its time to go you start up together. Ship one lead the way out to the runway with ship 2 in trail. Work out a plan to do run ups that doesn't involve blasting each other. Ship one lines up on the left side of the runway, ship two on the right. Ship one goes, ship two counts to twenty and goes. Fly the plan.
If you go out with a yahoo idea to fly formation you could wind up in dutch. If you make a plan and stick with it you can do it safely. Just remember to account for contingencies.