Copying filtered data in Google Sheets

What is the correct method for copying data in a filtered view in Google Sheets?

For example, in the image below, I want to copy the cells with values 1 & 3 and paste them into the cells with value a & c.

enter image description here

If I filter the view to only show those values, I want to make sure that the cells with value 2 & b are not impacted.

enter image description here

I am raising this question since I made assumptions that ended up corrupting a lot of data on a Google sheet.