It all depends on how your theme’s header.php
is structured, but the most likely way is via the document_title_separator filter, as in
add_filter ('document_title_separator', 'wpse_set_document_title_separator') ;
function
wpse_set_document_title_separator ($sep)
{
return ('|') ;
}