Anet board - MOSFET replacement?
There are two areas of this design which seem to pose a risk of connectors overheating, the hot end and the heated bed. The heated bed runs at about 6 amps, 12 Volts. The hot end runs at a lower current, but can itself overheat if the thermistor stops providing feedback.

The problem in this design with the heated bed is mainly the connectors - they work OK when they are good, but can easily come a bit loose. This has two side effects. The bed heats less well, and the connector itself heats instead. Replacing the 2mm plug connector, and 2mm molex with direct soldered connections will help (the on-board mosfet seems OK with the current, unless you increase the power rail voltage).

A mosfet is a good solution for high current switching, the modules available have good screw terminals which should be OK for maybe 25A (well in excess of what you need). Mosfets are efficient when switched fully on, so there won't be much heating.

You would also use a relay (rated for at least 10A), but this will be noisy since the heater is switched repeatedly to maintain the target temperature. A relay also takes more power itself and will ear out if repeatedly switched under load.

Bottom line, if you have a good relay already, it is OK as a temporary (safe) solution. Longer-term a mosfet is better. Pay attention to the connectors at power supply, board (in and out) and heated bed. Using an additional mosfet for the hotend is maybe overkill.