What a hat means
A "hat" is a circumflex accent placed over a letter, and it changes what the symbol means. In statistics, a hat marks an estimate: β̂ (beta hat) is an estimated regression coefficient, p̂ is a sample proportion, and ŷ is the value a model predicts. B̂ is the estimate of a parameter called B.
In physics and engineering, a hat marks a unit vector, a vector of length 1 that only shows direction. î, ĵ and k̂ point along the x, y and z axes, and B̂ is the direction of a magnetic field B. In quantum mechanics, a hat marks an operator, as in Ĥ for the Hamiltonian.
B̂ is a letter plus a combining mark
There is no single Unicode character for B hat. B̂ is the capital B followed by U+0302 COMBINING CIRCUMFLEX ACCENT, which attaches itself to the letter before it. The same mark works on any letter or Greek symbol, which is how β̂ and k̂ are made.
Some hat letters do exist as single characters because languages use them: ŷ comes from Welsh, Ĥ and ĵ from Esperanto, and î from French. Those display reliably everywhere. Combined ones such as B̂ depend on the font, so the hat may sit slightly off center or crowd a tall capital in some apps. If it must look perfect, use an equation editor or LaTeX.
A plain caret is a common fallback in plain text (B^), but ^ is a separate character that sits beside the letter, not above it.
How to type B hat
In Word, type B, then 0302, select just those four digits and press Alt + X. Selecting matters here because B is also a hex digit, and Word would otherwise read B0302 as one code. For letters that are not hex digits, such as x or y, typing 0302 and pressing Alt + X is enough. Inside an equation, B\hat followed by a space works too.
In LaTeX, write \hat{B}, or \widehat{AB} to stretch a hat over several letters; for unit vectors, \hat{\imath} and \hat{\jmath} drop the dots. In HTML, write B̂, since 770 is the decimal value of U+0302. For bars instead of hats, see the mean symbol page, and for β itself, the beta symbol.