In your terminal Ctrl+a will return you to the start of whatever line you have typed, and ctrl+e will return you to the end.
C-r will search backward in your history allowing you to type partial matches (like, "I know I compiled foo.c, but what options did I use?" type `C-r foo.c` and repeatedly type C-r until I find the compiler command I used).
https://www.gnu.org/software/bash/manual/html_node/Bindable-... - for a lot more options
You can switch to vi keybindings with `set -o vi`.
(Never used macOS. Welp. Guess I have a lot of relearning to do.)