Safely and legally are not necessarily the same thing.
A lot depends on where you plan on splicing. If this is intended for splicing into the mains wiring of a facility or home the requirements will be significantly different to say splicing into the cheapo zipper cable that's attached to your table lamp. Further, depending on where you live, codes may differ.
The crimped spade connectors indicated in Joren's answer are probably the handiest to work with, but do suffer from installation issues if you are not using the right tools or the right kinds and diameter of wires. I have seen the wire come out of those too many times.
If it's for splicing into single core mains cable, push in connectors are acceptable and available in some regions, "wire nuts" are widely used in North America, but ultimately, you can't beat screw down connectors.
A bigger issue though is enclosing all that, possibly in a grounded "box", and including sufficient strain relief and or clamping to ensure no tension or twisting forces on the cable can be transferred to your connection.