if you want to fix to a lath and plaster wall, find the timber studs by knocking on the wall, or by drilling a hole in it and poking a bit of wire sideways, then measuring. It will probably crack anyway, but if you screw to the studs they will probably hold your cupboard. If the cupboard is not the right width, screw a batten to two or more studs and fix the cupboard to the batten. You do radiators the same way.
If fixing to a crumbly brick wall, make a good long hole, then hoover out all the dust, then wash it clean with a plant sprayer squirted into the hole. When it is dry find a plastic plug that suits your screw size, then squirt "no more nails" or similar into the back of the hole and pump until it comes towards the surface . Poke the plasplug into it. When it is set, the next day, it will give a nice strong fixing to screw into. Use a screw length that penetrates well into the brick, not just the plaster.
verify that the hole is deep enough to take your screw, and wide enough to take your plug, before you stop drilling it.
If your drill has hit hard stone, you must use a good masonry bit and a hammer drill. If it is metal e.g. a lintel, change to an HSS twist drill.