I have an MIT-licensed (in plans, currently it's not published) project. And I've found an implementation of the required algorithm in an LGPL-licensed project. Am I allowed to include that code in my project? And if so, how exactly do I state that code is copied from that file?
IANAL/IANYL. That said, it seems to me that yes, you may, provided you conform to the GNU LGPL's obligations.
In brief those seem to me to be
That you license the modified LGPL work under LGPL (or GPL3, but that would interfere with your desire to distribute the rest of the work under an MIT licence)
That you include copies of the GPL and the LGPL with the work
The other obligations seem automatically fulfilled by your distributing the rest of the work as source. The easiest way to handle the code and its copying seems to me to be to keep all the LGPL-derived code in separate source file(s), which clearly state at the top the original authors' and your copyrights, and that the files are licensed under LGPL.
If your code as written displays any kind of copyright notice at runtime, you must also
include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
I note in passing that one of the main ideas of distributing something under an MIT licence is to permit later use in proprietary software. In the case of your project, such later use will be made much more difficult by the presence of LGPL'ed content (it's possible, but complying with the LGPL gets more onerous when there's no general source distribution). This makes the choice of MIT a bit perplexing; do consider, however briefly, distributing your project under GPL3 instead, as you could then relicence the LGPL-derived content under GPL3 (LGPL s2b) and the whole project would be under a single licence.
If the amount of code you're taking is too small to be independently copyrightable, you may be able simply to reuse it. I would advise getting a real legal opinion before you do that.