This is one of the common accidents, the "right hook". https://velosurance.com/blog/how-to-avoid-most-common-riding... https://www.fcgov.com/traffic/pdf/bicycle-crashes.pdf
I mostly walk these days but when I did bike I had these crash patterns memorized so I could avoid them.