Line that appears after typing —, ===, etc. and pressing enter is not a line, it’s page border. Hence, it cannot be selected for removal or editing. To remove line in Word, follow these steps.
Steps to remove line in Word
Step 1: Move cursor to immediately before line that needs to be removed
Step 2: In the Home tab, click on the down arrow next to borders in paragraph group, as shown below

Step 3: Select no borders to remove line in Word
