Yes, magnetic cabinet locks can be very effective. They are often discreet, installed inside the cabinet, and are typically strong enough to prevent children from opening the cabinet. But the magnet key should be kept out of reach of children.