Yeah, we usually use a relay for this. Either an old-fashioned coil-operated one or an all-electric solid state relay.
But this, combined with your question, for me is a contraindication that you should be doing this. Build a decent basis of electronics knowledge and awareness of safety issues beforemessing with 230V (or 115V).