Replace hard return (paragraph break)

how to replace a hard return by something else, for example nothing or a space?

What’s your understanding of “hard return”?
Are you talking of a forced line break or of a paragraph break (or of something else)?
(It makes a big difference!)

I mean the thing I get when I hit Enter when I am writing a text. The point of it is that I often want to find and replace two of those by one. In several other programs I can do that by stating that I want to replace ^p^p by ^p. The other way round also occurs: often I want to change many or all occurrences of comma plus space by ^p. Does that answer your question?

(Never ever suppress the display of formatting marks. By default this is controlled by the pilcrow icon in the Standard toolbar.)

So, you are talking of paragraph breaks.
I haven’t an idea concerning your “several other programs”. LibreOffice is using the wide-spread Regex engine by ICU for the purpose.
If you want to remove spare empty paragraphs in a text range, you can use F&R (now Ctrl+H by default), RegEx enabled, with ^$ in the Find: line and an empty line behind Replace:
Only in this special case the paragraph break is treated as if contained in the finding. Otherwise it only restricts the search to “occurring at the end of a paragraph” like a lookahead assertion.
Single findings never cross paragraph breaks.

The following question isn’t covered by the subject, but I will try to answer it in the context because it’s also handled by the mentioned extension.

This is simple:
The comma and the space behind Find:
\n behind Replace:
You can’t insert hard line breaks with F&R.

Also: There is an extension to LibreOffice Writer linked-named Alternative Find and Replace (AltSearch in short).
It wasn’t updated for a long time now, but it still works properly afaik. Personally I don’t use it.
It’s less efficient, but can search across paragraph breaks, and offers more options.

Thanks a lot for this detailed answer! I will try it out and report back. But thanks anyway!

I tried it out and it worked as you foretold it would: it can substitute two or more paragraph breaks by just one, and it can substitute a string (for example comma plus space, but also many other strings) by a paragraph break. Great.
I also installed AltSearch, which covers a need I had shortly: it can find a series of 3 paragraph breaks (important in a very large list where the entries are separated by 2 paragraph breaks).
I will check the help on Writer and see if I could not have found out all this by myself; if my conclusion is that I couldn’t, I will suggest an improvement on help. But for now: many thanks!! You made my day!

It is possible to use F&R dialog and use single $ in Find: for Enter (check Regular Expressions).

Yes indeed. Thank you!